MV How to switch the main character with one button?

I'm moving my game from VX Ace to MV. Is there a way to change the party leader with a button?
This is what I did back when the game was on Vx Ace (thanks to @Shaz for the help back then). Should I adapt it to MV (may I ask how, though) or is there a plugin that can do it?

Swap1.PNG
swap2.PNG
You'd use a plugin like Hakuen Studio Button Common Events and put I think $gameParty.swap(0,1). That'll make the second member the leader, if you want it to be a different member change 1 to that member's position or use a variable.

If you want to change the leader to someone not in the party, you would have to add that member then remove the current leader.
You'd use a plugin like Hakuen Studio Button Common Events and put I think $gameParty.swap(0,1). That'll make the second member the leader, if you want it to be a different member change 1 to that member's position or use a variable.

If you want to change the leader to someone not in the party, you would have to add that member then remove the current leader.
Are you referring to $gameParty.swapOrder(0, 1)?

JavaScript:
Game_Party.prototype.swapOrder = function(index1, index2) {
    const temp = this._actors[index1];
    this._actors[index1] = this._actors[index2];
    this._actors[index2] = temp;
    $gamePlayer.refresh();
};

I think .swap only swaps the Game_Character x/y position with another character.
Are you referring to $gameParty.swapOrder(0, 1)?
That's probably it. I'm phone posting so it's hard for me to look up the script easily and I was going off memory.
here is the evented way, you can read the thread if needed.
here is the evented way, you can read the thread if needed.
That only changes the party leader's image. If you need more of the leader's properties like their name, skill lists, etc. you'll want to change the member entirely.
here is the evented way, you can read the thread if needed.
That changes only the graphics. It won't do, since the game relies on puzzles that get solved depending on the character.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-switch-the-main-character-with-one-button.170454/