Bypass 100% Remove by damage states (I.e. Sleep) taken off upon hit.

I hope this isn't a very complex request, but basically a plugin where if a state that usually gets taken off upon it, let's say a 100% Remove by Damage Sleep State usually gets taken off, well certain skills will bypass it and won't remove the state.

The only condition is, I'd like the Plugin to work with Yanfly Plugins.

I can achieve what I want through making all skills remove Sleep except the ones I want to bypass, so I don't need this plugin now, but I think a plugin like this could still be useful, and is a better method then that.

So, for that reason, I thought, whether it happens or not, there isn't any harm in requesting it.

Thanks for listening to the request! : )
it can be done with yanfly stateand buff plugin, but you might need state category plugin as well because if im recall correcly, it can bypass
some states you want, but it require lunatic code 🙂
if (b.isStateAffected(X)) b.addState(X); formula
damage formula checks if they are sleeping. if so it reapplies sleep as it hits so they stay sleeping. otherwise it just does a normal hit
@Tiamat-86

I tried if (b.isStateAffected(10)) b.addState(10); a.atk * 4 - b.def * 2

and
if (b.isStateAffected(10)) b.addState(10);a.atk * 4 - b.def * 2

in Battle Test.

They didn't reapply the Sleep State (which was ID 0010). I'm sure there is a damage formula close to that would actually do it, however still it wouldn't really bypass the state, just take it off and on. Visually, you'd see that happen too.


@ShadowDragon I thought that much would be true, my problem is, if it does work, I don't know the lunatic code to put in. But thanks.
States are removed after the damage is applied, which occurs after the damage formula has been evaluated, hence no dice with that. Also, simply reapplying the state would also reset the state's turn count unless you had some extra code to remember/reset that. 😅

So, I wrote this li'l plugin: Cae_StateControl.
Spoiler: Full code (embedded file)

Then let's say you have a skill that shouldn't remove state 10 on damage: just add a notetag to that skill~
Code:
<Ignore State Damage Remove: 10>
Should be compatible with most stuff that doesn't entirely overhaul the flow of damage. All it does is temporarily change the remove chance to 0 for relevant states (and resets it after the "remove by damage" check has completed). 🙏
@caethyril I'm sorry I took so long to respond, but thank you for this! I hope more people can find more use for it too, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/bypass-100-remove-by-damage-states-i-e-sleep-taken-off-upon-hit.109944/