If you are looking at the refund meter to determine these numbers - the refund meter will zero out at the start of the amendment process. From then on, the refund meter during the amendment process only shows the differences from changes you made from your original return. Your original refund will still be paid to you.
So, if your original refund was $1000 from Maine and now after changes it says you owe $100, that means you have to send back $100 from the original $1000 refund, not that your entire refund has been lost and now you owe $100. So, you will net $900. And the same for your Federal - you will still get your original refund - any new refund or amount due would be separate.