I would do it like this. Make a variable that stores the actor id of the party leader. Then, when ever the leader changes you only have to change the value in the variable to the new leader's id. Then, instead of putting the actor id in the plugin script you put the game variable, like this:
Game_Party.prototype.leader = function() {
if ($gamePlayer._followers.isVisible()) {
return this.battleMembers()[0];
} else {
return $gameActors.actor($gameVariables.value(NUMBER_OF_YOUR_VARIABLE));
}
};
Replace NUMBER_OF_YOUR_VARIABLE with the number of the variable you store the actor id in.