Switching an actor as party leader through script command

Hey guys!
Is it possible to switch one actor as party leader through a script\event?
You'll need an event that removes all the other party members except the new leader, and then adds them back. This forces the new leader to be pushed to the top position.

Or you could use a plugin. http://himeworks.com/2015/11/custom-party-leader/

Original thread: https://forums.rpgmakerweb.com/threads/switching-an-actor-as-party-leader-through-script-command.85402/