MV K-O state resistance not taken into account

I'm using a lot of YEP's plugins.
While other states (such as poisoned) seem to be taken into account, K-O resistance is not.
If I put 0% the enemy can still be insta-killed by a skill using, for instance, Add State K-O 100% (or even 90%).
I tried to see if 0% was the problem so I put 1% instead but I still got the insta-kill each time.
Basically it seems only the spell effect matters (ie Add State xx%), the enemy resistance is completely overlooked... which is extremely bad.
What's happening there? Any clue why the K-O state isn't behaving properly? Is it a glitch in YEP's plugins?
Does the skill that shouldn't kill also deal damage?
The way the engine processes units reaching 0 HP is by a good old target.addState(1) which applies the state as long as the target doesn't have a state immunity, disregarding reduced state rates.
What happens if you replace the state rate of 0% by a state immunity?
Not sure about what effect Yanfly's plugins might have, but by default there are two types of traits for "state resistance":
  • State Rate:
    • Multiplies the state apply chance.
    • Ignored by skills of Certain Hit type.
    • Does not affect states already present on the bearer.
  • State Resist:
    • Makes it impossible for the state to exist on the bearer.
    • Removes the state (if present) when the State Resist trait is added to the bearer.
It sounds like you'd want a State Resist trait here.
@caethyril
It sounds like you'd want a State Resist trait here.


Felt the same as you.
Yet, this makes the monster invincible. Reaches 0HP, doesn't die. Not good.

What happens if you replace the state rate of 0% by a state immunity?

See above.

EDIT:
That said, do you mean to say by this:
"Ignored by skills of Certain Hit type. "
that the monster resistance is no longer taken into account? If so, then this is totally the issue.
Then maybe a passive state on it that gives the state immunity would work. In the condition for this passive to stop working (so the statement that sets condition to false), put in how you want the enemy to lose its immunity to death.

Note: From a game dev to another, make sure there's clarity in the method to remove the immortality.
@caethyril
You were right, this is because of CERTAIN HIT.
At this point I wonder if there could be a quick fix to just remove whatever line makes CERTAIN HIT skills bypass the enemy state resistance. Is it also the same with attributes (fire, ice etc)?
I don't particularly like this take on CERTAIN HIT to be honest.
@CHKNRAVE
Or changing the skill to "magic" instead. Adding a passive state seems to complicate things IMO. I just wish certain hit skills wouldn't bypass enemy resistances.
Oh, of course, I completely overlooked that. Certain hit skills do always land, their states as well.
At this point I wonder if there could be a quick fix to just remove whatever line makes CERTAIN HIT skills bypass the enemy state resistance. Is it also the same with attributes (fire, ice etc)?
You can save this as a .js file (copy into a text-editor, Save As > File Type: All Files, Filename: whatever.js) and import it as a plugin:
Spoiler: plugin code
JavaScript:
Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
    var chance = effect.value1;
//  if (!this.isCertainHit()) {
        chance *= target.stateRate(effect.dataId);
        chance *= this.lukEffectRate(target);
//  }
    if (Math.random() < chance) {
        target.addState(effect.dataId);
        this.makeSuccess(target);
    }
};
This is just the default method with the Certain Hit check removed. 🙂

Certain Hit just makes the skill and its states always apply, it doesn't affect skill damage/elements/etc.
It seems to me that it worked. Thank you, you're a lifesaver. <3
@caethyril
Just a question: how hard would it be to make certain hit skills be affected by PDR and MDR?
I don't know if I'm such a fan of them NOT being affected by that too.
I mean, to me certain hit always meant you would never miss no matter CNT, MEV or MRF of the opponent. It wasn't really about immune to everything. Just my 2 cents anyway.
I think the developers designed Certain Hit for ally-related skills, but I agree that it does seem to cause a lot of confusion! 😅

By default a skill's hit type is what determines whether a it is physical, magical, or "other" (i.e. Certain Hit). This is used to decide what damage reduction to apply: PDR, MDR, or none. How would you determine which damage reduction to apply to which skills?

Instead, I'd suggest including the damage resist in the skill's formula, e.g.
Code:
Math.round((a.atk * 4 - b.def * 2) * b.pdr)
Math.round just rounds to the nearest integer. 🙂

[Edit: oops, PDR/MDR are damage rates, not resistances.
Corrected * (1 - b.pdr) in above example to * b.pdr. 😴]
Actually a pretty cool idea, thanks! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/k-o-state-resistance-not-taken-into-account.127871/