MV Effect for non-damaging spells with imperfect accuracy? (Yanfly Skill Core/Buff & States Core related)

Assuming I wanted to execute some type of code on a non-damaging spell that has imperfect accuracy, but have this effect only take place if it hits, is there a notetag within Yanfly's plugins that would let me do this? Using <Before Eval>, <After Eval>, or <Damage formula> seem to apply the effect regardless of whether the skill hits, but because the skill doesn't deal damage, using <Pre-Damage Eval> or <Post-Damage Eval> gets ignored if I try to use those. Under normal circumstances I'd simply use the effects parameters provided in the UI, but the intended effect I'm trying to apply to the target is a bit more complex than that (ie: changing how many stat debuffs are applied based on specific conditions.)

On a related note, is there a setting that would allow stat buffs to wear off after battle? I know the option exists for states, but can't seem to find anything similar for stat buffs, which is kind of annoying to deal with since they seem to persist on the actors after battle if there are turns remaining.
You can use After Eval and see whether the skill hit.

Code:
if (this.isHit())

You could also program it into an Action Sequence if you're using those, but it would be the same check:
Code:
if (target.result().isHit())

On a related note, is there a setting that would allow stat buffs to wear off after battle?
This is the default behavior of MV - if you're seeing buffs persist after battle, you must have added a plugin that does it.
You can use After Eval and see whether the skill hit.

Code:
if (this.isHit())

You could also program it into an Action Sequence if you're using those, but it would be the same check:
Code:
if (target.result().isHit())
Tried doing that but it doesn't seem to be taking effect if the skill hits. Here's my code for reference:
Code:
<After Eval>
var turns = 0+2*(user.isStateAffected(53))+1*(target === user);
if (this.isHit()) {
  target.addDebuff(6,3+turns);
  target.addDebuff(6,3+turns);
  if (user.isStateAffected(97)) {
    target.addDebuff(6,3+turns);
  }
}
</After Eval>

The only purpose of states 52 and 97 are passive states that extend the duration and stacks of each buff, respectively.


This is the default behavior of MV - if you're seeing buffs persist after battle, you must have added a plugin that does it.
Is this a setting in any of the Yanfly plugins? Those are the only ones I can think of that might be causing this.
EDIT: Upon further testing, it seems as if this behavior only occurs when using a skill that forces a battle to end; attempting to escape the battle or defeating all enemies causing the buffs to be removed after the battle. Any idea what causes this and/or how to resolve this?
Tried doing that but it doesn't seem to be taking effect if the skill hits.
Change it to if (target.result().isHit())

EDIT: Upon further testing, it seems as if this behavior only occurs when using a skill that forces a battle to end; attempting to escape the battle or defeating all enemies causing the buffs to be removed after the battle. Any idea what causes this and/or how to resolve this?
Well, how are you forcing the battle to end?

Original thread: https://forums.rpgmakerweb.com/threads/effect-for-non-damaging-spells-with-imperfect-accuracy-yanfly-skill-core-buff-states-core-related.171603/