Questions about States and Parameters

Hi, I have a couple questions regarding some stuff on states and their parameters (and some adjacent stuff).

  1. If you have State A applied, and then State B is applied, but B has the Trait “State Resist: A”, does State A stay on the battler or not?
  2. I’m not entirely sure of Remove by Restriction’s scope. As far as I understand it, if any state with a different Restriction is applied, then the State with that option checked is removed? It applies to every one of them?
  3. Is it possible to have a State lose turns duration on certain actions? For example, a Burn State loses one (or all!) its turn duration when hit by a Water-Element attack.
  4. For that matter, if it’s possible to make a State’s effects stronger depending on turn duration? Like a Poison that does 5% + X% HP damage, where X is the number of turns it has remaining.

For 1, State A comes off. State Resist doesn’t only block new applications, the battler erases any state it currently resists on refresh, so applying B knocks A off right away. That’s the difference between it and a State Rate of 0%, which stops new applications but leaves anything already on the battler alone.

For 2, my understanding is it fires when a battler goes from unrestricted to restricted, and at that moment every state on them with Remove by Restriction checked comes off, not just one. The part that trips people up is that the incoming state counts too, so a state that carries a Restriction of its own and also has that box checked will remove itself the instant it lands.

For 3, if you want Burn gone entirely, that’s just an Effect on the water skill, Remove State → Burn. Shaving off a single turn isn’t exposed in the database. The counters live on the battler in _stateTurns keyed by state id, so a damage formula can reach in and drop one. For Burn as state 5 it’d look something like this:

b.isStateAffected(5) ? (b._stateTurns[5] = Math.max(b._stateTurns[5] - 1, 0), a.mat * 2 - b.mdf) : a.mat * 2 - b.mdf

The state won’t vanish the moment it hits 0, it clears at its normal auto removal timing. I’d test that one carefully before building around it, since the formula gets evaluated once per hit and a repeat count of 3 would eat three turns instead of one.

For 4, slip damage comes from the HP Regeneration trait, which is a flat percentage with no hook for reading turns left. VisuStella’s Skills and States Core adds a <JS HP Slip Damage> notetag where the damage is a formula you write, and that’s where I’d put the 5% + X% math with X pulled from the remaining turn count.

Really? I didn’t realize how niche this setting was. I never really bothered with it tbh.

So that means that doing something like the formula above is only really useful for single-target, single-hit moves?

I see. Well, VS Skills and States adds a lot more than just that so I’m iffy on adding it right now. Maybe later though, if I really want scaling States alongside whatever else the plugin adds.

This one doesn’t need the whole suite. Scaling poison by turns lives in a single function, Game_Battler.prototype.regenerateHp, so a plugin that only does that is around 15 lines:

(() => {
    const POISON_ID = 6;
    Game_Battler.prototype.regenerateHp = function() {
        let rate = this.hrg;
        if (this.isStateAffected(POISON_ID)) {
            const turns = this._stateTurns[POISON_ID] || 0;
            rate -= 0.01 * turns;
        }
        const value = Math.max(Math.floor(this.mhp * rate), -this.maxSlipDamage());
        if (value !== 0) {
            this.gainHp(value);
        }
    };
})();

That rewrites the function instead of aliasing it on purpose. gainHp writes to _result.hpDamage, so calling the original and then adding a second gainHp for the extra damage leaves the popup showing only the second number. Keeping the extra inside the maxSlipDamage clamp matters too, since that’s what stops slip damage from killing someone when Knockout by Slip Damage is off.

One timing thing, onTurnEnd runs regeneration before updateStateTurns, so the turn count you read still includes the turn that’s ending.

I haven’t tested this, so take it as the shape rather than something to drop straight in.

Funnily enough, after trying it out raw just to see if it would work fine, it works just about as I expected it to! The only difference being that, for example, if the poison base was at 8% it ended at 9%. I fixed it though.