Issue setting MP to a certain starting point @ the start of battle...

So I want my party's MP to start at a certain value at the start of battle - more specifically, I want their MP to be set to whatever their Magic Defense stat is. But I'm getting a very weird result (even before the update to 1.6.0)

So I have an event kicking off the battle, which flows as follows:

◆Change MP:Entire Party, - 9999
◆Control Variables:#0002 Char1 MP = M.Defense of Char1
◆Control Variables:#0003 Char2 MP = M.Defense of Char2
◆Control Variables:#0004 Char3 MP = M.Defense of Char3
◆Control Variables:#0005 Char4 MP = M.Defense of Char4
◆Change MP:Char1, + {Char1 MP}
◆Change MP:Char2, + {Char2 MP}
◆Change MP:Char3, + {Char3 MP}
◆Change MP:Char4, + {Char4 MP}

I have the MP drop to 0 (via the -9999 command) right away since there's no "Set To" option when it comes to the Change MP option, only "Increase" or "Decrease". So the event seems to work in that it reduces the party's MP to 0 right away, and then raises the party's MP. The issue I'm having, however, it that it raises everyone's MP to a flat 100. Everyone's MDF stats are a bit higher than this, and I just don't understand where my sequencing is going astray. No matter what I adjust, their MP just drops to 0, then raises to 100.

Any thoughts?
Does your TP play a huge role in your game? Because if you used your TP the way you use your MP this would be super easy to do with Yanfly's Enhanced TP: http://yanfly.moe/2016/01/08/yep-55-enhanced-tp/

Second thing to consider: Do you characters have some kind of multiplier on them from a state or from a trait? That could be messing with your calculations.

Now, my solution (or the first one that comes to mind) 🙂: You could use Yanfly's Base parameter control found here: http://yanfly.moe/2016/03/25/yep-86-base-parameter-control/

and paste this inside each class' notetag:
<Custom Class Parameters>

maxmp = user.mdf;

</Custom Class Parameters>

Then simply restore all their mana at the beginning of each combat and you'll be good. If this doesn't work for you or for any ohter reason contact me and I'll try to help you if I can.

Cheers and good luck with your project 😉
As for what might cause your flat 100 now, what is the max MP of your characters?

Original thread: https://forums.rpgmakerweb.com/threads/issue-setting-mp-to-a-certain-starting-point-the-start-of-battle.91885/