Variable For Player MP?

So, I've been working on an event battle system, which, for the most part is working smoothly, however, I am trying to make it possible to use magic. I want to use a conditional branch with a variable to check if the player can use magic, but I don't know how to assign MP to a variable for the player. I know how to assign an Actor's MP to a variable, but my game has a system to switch characters in game, and I was looking for a way to avoid assigning a variable to every individual actor in the party. Thank you in advance.
If I understand you correctly, you want to assign the variable based on which actor is currently the first member of the party rather than assigning based on a specific actor?


The script line $game_variables[25] = $game_party.members[0].mp will assign the party leader's (that is, the current first member of the party) to Variable #25, for example.  members[1] would be the second member of the party instead.  You would use this in a "Script..." event command.  You could also just use the "Control Variables" event command and use the script option, typing in only the following: $game_party.members[0].mp
I thought it would be something like that! Thank you so much!  🙂 This thread can be closed. 
You could also use Control Variables and put $game_party.leader.mp into the Script box.  Does the same thing.
That's pretty much what I did because I know the script call for variables so I figured it'd do the same thing anyway.

Original thread: https://forums.rpgmakerweb.com/threads/variable-for-player-mp.61931/