ebf, formula, poop, underweight baby

Baby was ebf until last week. She’s 3 months exactly today. Weighed 7lbs 1oz at birth and weighs 10lbs 10oz today. She had a medical problem that was preventing her from putting on weight, was growing in every other way and early on all milestones so far but just couldn’t keep any weight on. She had surgery last month to correct the problem and has been so much happier. Thing is leading up to surgery she had gone from 20% to 4% in weight and had stopped gaining completely which is why the surgery was done. After the surgery she slowly started gaining a few ounces but not enough to go up on her chart which docs wanted. Two weeks ago she dropped to 1% so they told me to supplement with formula bc she’s failing to thrive. Well in one week she gained almost 1lb and went up to 5%. But my milk supply has been dropping. I’ve tried to get my milk up but it’s not working. I had been giving her half formula half breastmilk (pumping). When I weighed her today she only put on 2-3 ounces since Friday. Her poop the last few days has been green and frothy and she’s been spitting up more. Her poop has never been this color. I don’t know if I should cut out breastmilk completely and only give her formula or if I need to switch formulas? I don’t know what to do. Docs said if she isn’t gaining well then I need to take her for more tests. Any help or ideas are very much appreciated. I’m so stressed from all of this and and getting so sick from worry I haven’t slept more than an hour a night in months.