So baby was gaining wonderfully until 2 months-exclusively breastfed? Prior to seeing your doctor, did you nurse only 5 or 6 times a day? Or was that only after?
I frankly cannot believe that nursing sessions being shortened by 2 minutes as the only change between prior to your two month appt and after it, prevented your baby from gaining at all for the next 2 months, after gaining perfectly normally prior to that. Rather, I suspect, that prior to the 2 month doctor visit, you were cue feeding-basically nursing your baby as much as baby wanted and as long as baby wanted, which maybe averaged 16 minutes but maybe went longer other times-I mean, were you timing feeds? I think once you saw your doctor, he put it into your head it was normal or preferable to have less feedings overall and these super short feedings as a rule. The result is, your baby has clearly not been getting enough to eat and your milk production may have been harmed!
I'll tell you, if this was me, I would not only be talking to another doctor, I would be making a formal complaint about this advice you were given. I have NEVER before suggested this, I may be in big trouble for doing so, but if things are as you say, this is very serious. I'm not kidding. The AAP knows that limiting feeding frequency in ebf babies may cause lack of adequate weight gain and even failure to thrive! This is very, very serious.
Some 4 month olds may not need to nurse 10 times a day. But plenty do. I have overproduction-actually, too MUCH milk, and my healthy and thriving 4 month old daughter nursed 7 times already today (I never count, but I did for you) and will nurse again when I go to bed and then overnight at least twice. So what do you know? That is 10. And there was nothing unusual about today.
I strongly, strongly, suggest, NURSE more. Yes, pump as you can, and give your baby what your pump, until you know baby is gaining normally again. But an effectively nursing baby nursing frequently enough, ups production better than any pump.