Remove state?

Hello,

I want to switch a state with another state for certain troops. For example, if a boss is successfully hit with Poison, I want to change the usual Poison state which is HP regen -5% to a less powerful Poison state -1%.

However, I can't even get the first part to work. I have a conditional branch where if enemy #1 has Poison state, then it should remove the state Poison. It simply doesn't work - I poison the enemy, and they continue to be dealt HP regen damage from the Poison state despite the condition for the event page in the troop being enemy HP being <=100%. I've tried turn 0 as well, I've tried turn end, enemy HP ... the friggin test bat refuses to lose the poisoned state

How do I make it so that if one state is applied to an enemy in a certain troop, it is instantly removed and another state applied in its place?
no need for a conditional anywhere.

you make two different poison states and have the skill apply both.
then give all normal troops 100% resist against the boss version and the boss 100% resist against the normal version.

If you want that troop event solved, you would have to show us a screenshot to see where you went wrong but as described above you don't need it.
Here's a quick plugin. Haven't had a chance to test thoroughly, but it should do what you are asking:

JavaScript:
//=============================================================================
// EnemyStateSwap.js
//=============================================================================
/*:
 *
 * @target MV
 * @plugindesc Swap state id upon application on an enemy-by-enemy basis.
 * @author Kenen
 * *
 *
 * @help EnemyStateSwap.js
 *
 */
var EnemyStateSwap = EnemyStateSwap || {};
EnemyStateSwap.addState = Game_Enemy.prototype.addState;
Game_Enemy.prototype.addState = function(stateId) {
    const ids = this.stateSwapIds();
    if (ids && ids[0] === stateId) stateId = ids[1];
    EnemyStateSwap.addState.call(this, stateId);
}
Game_Enemy.prototype.stateSwapIds = function() {
    if (!this.enemy().meta.StateSwap) return null;
    const meta = this.enemy().meta.StateSwap;
    return meta.split(',').map(Number);
}

Add <StateSwap:x,y> to your enemy note tag (e.g. <StateSwap:15,16>). State id 15 will be replaced with state id 16 for that enemy upon state application.

RPGMV_rZrchTOtZ2.png

Original thread: https://forums.rpgmakerweb.com/threads/remove-state.148509/