MV Targeting party member position instead of actor?

Hello, I am looking for a little help. I have set up a common event that looks like this. The goal is that if in battle the player's entire currently alive active battling party has < 1 MP (negatives are possible in my game) the common event will grant them mp.

◆If:Script:$gameActors.actor(1).mp < 1
◆If:Script:$gameActors.actor(2).mp < 1
◆If:Script:$gameActors.actor(3).mp < 1
◆Change MP:Entire Party, + 7
◆
:End
◆
:End
◆
:Else
◆
:End

My problem is this; I intend for my game to have more than 3 characters. I'm sorry I don't know the proper name for this, but I would like for this event/script to check the "slots" or positions that the characters are occupying, so that it could check ANY character placed in the party. I think this code only works if the party currently consists of those three actors, and wouldn't work if there were other actors.

I tried for a very long time to get it to detect the party as a whole, and finally got it to function as intended by basing the conditional on actors instead and nesting "ifs". All of the other scripts I tried included multiple variables and booleans, but it wasn't working out.

Currently, this functions "as intended" inside the common event but im worried about problems in the future. As extra information I am calling the common event through a skill via yanfly's action sequences.

TLDR; how do i make
If:Script:$gameActors.actor(1).mp < 1
call not on the specific actor, but on either A) the whole allied party currently battling not dead, since thats the ultimate goal or 😎 the allied party currently battling roster position, so that it will still target all party members regardless of which actors are placed in those positions.

Very sorry if I worded this in a confusing way.
you can use this:
Code:
$gameParty.battleMembers()[member_index]
change member_index to the index of your battle member
0-> first member
1-> second member
2 -> third member
and so on

hope this help.
you can use this:
Code:
$gameParty.battleMembers()[member_index]
change member_index to the index of your battle member
0-> first member
1-> second member
2 -> third member
and so on

hope this help.
Ill try this, thank you.

Original thread: https://forums.rpgmakerweb.com/threads/targeting-party-member-position-instead-of-actor.136622/