Any way to change the game over image based on leader and/or switch?

I want to know if there is a way to change the image of the game over screen based on the current party leader or depending if a certain switch is on.
Any way to do this?
Rpg Maker doesn’t let you change the game over image dynamically, but you can bypass the default game over entirely and build your own. a simple safe method is to intercept the defeat, fade out, transfer to a blank “Game Over” map, and show whatever picture you want based on a switch or the current party leader. No plugins or code required.

You can intercept the defeat in your Troop event (Turn 0 or Battle End), add a conditional check for party death and call your custom game over common event.

Example common event logic:
If Switch X is ON
Show Picture: GameOver_Special
Else
If Actor 1 is the party leader
Show Picture: GameOver_Hero1
Else If Actor 2 is the party leader
Show Picture: GameOver_Hero2
Else
Show Picture: GameOver_Default

This is just raw idea, from there, add your fade in, dialogue, and choices (Retry or Title Screen), plus any map transfers you may want.
You can also just slap multiple images in the system image folder and put a plugin, something like this:

Scene_Gameover.prototype.createBackground = function() {
this._backSprite = new Sprite();
let image = "";
switch($gameParty.leader().actorId()) {
case 1:
image = "GameOver1"
break;
case 2:
image = "GameOver2";
break;
case 3:
image = "GameOver3";
break;
case 4:
image = "GameOver4";
break;
default:
image = "GameOver"
}
this._backSprite.bitmap = ImageManager.loadSystem(image);
this.addChild(this._backSprite);
};
You can also just slap multiple images in the system image folder and put a plugin, something like this:

Scene_Gameover.prototype.createBackground = function() {
this._backSprite = new Sprite();
let image = "";
switch($gameParty.leader().actorId()) {
case 1:
image = "GameOver1"
break;
case 2:
image = "GameOver2";
break;
case 3:
image = "GameOver3";
break;
case 4:
image = "GameOver4";
break;
default:
image = "GameOver"
}
this._backSprite.bitmap = ImageManager.loadSystem(image);
this.addChild(this._backSprite);
};
Is there any way so certain actor's game over images change when a switch is turned on?
Yeah, I guess just throw conditionals in the cases (change x to switch id), for example:

case 1:
if ($gameSwitches.value(X)) {
image = "GameOver1A"
} else {
image = "GameOver1B"
}
break;

Original thread: https://forums.rpgmakerweb.com/threads/any-way-to-change-the-game-over-image-based-on-leader-and-or-switch.182217/