How to make only the lead player take floor damage?

I'm trying to code a game where there are two main characters who have separate health bars, and that's shown visually onscreen. You can rotate who's in the lead between the pair.

I was experimenting with floor damage, but both characters in the party will be damaged if the leading character steps onto a tile with floor damage active on it. I'd prefer for it to only damage the leading character.

Is there any way to make it so that only the lead player take floor damage?
How do you rotate, just through the Formation menu or something else?

The method that I think is trickier is you could get a state onto whichever actor isn't in front that has the Floor Damage * 0% trait on it.

The kinda easier method is to not use floor damage tiles. Put events there instead and the event uses conditional branches to do a flash and damage only the actor that's the leader.
There are also plugins that will run a common event or script by region or terrain tag if you don't want event clutter or want to put other events on those tiles
I haven't tested it, but if my brain isn't too addled by the fever that I'm currently running, this should make it so that only the party leader takes floor damage. Just put it in a new .js file and add it to your project as a plugin:
JavaScript:
(() => {
    const _Game_Actor_executeFloorDamage = Game_Actor.prototype.executeFloorDamage;
    Game_Actor.prototype.executeFloorDamage = function() {
        if (this === $gameParty.leader()) {
            _Game_Actor_executeFloorDamage.call(this);
        }
    };
})();
There are also plugins that will run a common event or script by region or terrain tag if you don't want event clutter or want to put other events on those tiles
Ooh, that's actually true, I have that plugin in my game atm. I can always use it as a backup if needed.

I haven't tested it, but if my brain isn't too addled by the fever that I'm currently running, this should make it so that only the party leader takes floor damage. Just put it in a new .js file and add it to your project as a plugin:
JavaScript:
(() => {
    const _Game_Actor_executeFloorDamage = Game_Actor.prototype.executeFloorDamage;
    Game_Actor.prototype.executeFloorDamage = function() {
        if (this === $gameParty.leader()) {
            _Game_Actor_executeFloorDamage.call(this);
        }
    };
})();
I tried this and it works! Thank you so much, I appreciate it, that'll be my problem solved 😀 Do I credit you for this plugin if it's ultimately used in the end?
I tried this and it works! Thank you so much, I appreciate it, that'll be my problem solved 😀 Do I credit you for this plugin if it's ultimately used in the end?
You're welcome. Nah, there's no need for credit. It's not a problem if you want to credit me, but it's not required.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-only-the-lead-player-take-floor-damage.162617/