Is there a way to add an actor to a certain party slot?

so here is some context. on my game there is a part where the main character leaves the team and gets possessed and so you need to fight him. but how do I add him back to party slot 1 when the fight is over and he returns to the team?
$gameParty._actors.unshift(id of MC);
$gamePlayer.refresh();
$gameMap.requestRefresh();
$gameParty._actors.unshift(id of MC)
could I have more info?
Put those lines in a "script" command at the point where you want to add the MC back in.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-add-an-actor-to-a-certain-party-slot.136984/