MV Summonning other party members

Hi, everybody. I've been scratching my head over the past few days, exploring functions and stuff, unfortunately I can't complete my skill that summons party members.

What I want to do is have every fight start with Actor #1 in battle, the rest of the party is in the reserve.
To summon the rest of the party, Actor #1 has a skill that serves that purpose. At first it builds a choice menu:
JavaScript:
choices = [];
for(ID = 1; ID < $dataActors.length; ID++) {
  if(!$gameActors.actor(ID).isBattleMember() && $gameParty.allMembers().contains($gameActors.actor(ID))) {
    choices.push($gameActors.actor(ID).name());
  }
}
$gameMessage.setChoices(choices, -1, -1);
$gameMessage.setChoicePositionType(1);
$gameMessage.setChoiceCallback(function(n){
  $gameVariables.setValue(2, choices[n]);
}.bind(this));
this.setWaitMode('message');
Which brings up every single party member that's not in battle right now. In return, Variable #2 becomes equal to the name of the member the user picked. I do this to end up with a party ID instead:
JavaScript:
for(ID = 1; ID < $dataActors.length; ID++) {
  if($gameVariables.value(2) == $gameActors.actor(ID).name()) {
    $gameVariables.setValue(2, $gameActors.actor(ID));
  }
}
actor = $gameVariables.value(2);
$gameVariables.setValue(2, $gameParty.allMembers().indexOf(actor));
console.log(actor);
console.log("Party ID of this actor: " + $gameVariables.value(2));
Now Variable #2 is that actor's party ID. And the next part is where I'm stuck.
I'm trying to swap that actor from its current slot to the previous one, until it's in the 1st reserve slot, and then increase the battle party size to make the summon come in. This involves Yanfly's Party System and the command $gameParty.changeBattleMax($gameParty.maxBattleMembers() + 1).

Not only does the swapping process ($gameParty.swapOrder($gameVariables.value(2), $gameVariables.value(2) - 1);) fail, but the party size increase results in the actor only appearing in the menu and never in the sideview. Can somebody help me with finishing up this mechanic? It's the very core of my current project. I already did the basic checks, plugin order and a ton of console.log() commands.

Thanks in advance.
I'm a little surprised you can't do this conveniently with the Party System and his Actor Party Switch. I would try first not messing around with constantly manipulating the party size, I'd just lock all the slots, then unlock one just before calling the actor switch and you should be able to bring someone into the empty slot.

Then, at the end of the battle, have an event that strips out all non-main character actors and locks the slots again.

But that's just my first thought...I'll take a look at your code after lunch, if no one else has come up with anything.
I see an option to lock actors in the plugin's documentation, but not the slots themselves.

Thank you for taking some time to help with my issue.

Original thread: https://forums.rpgmakerweb.com/threads/summonning-other-party-members.134340/