MV Certain Hit Critical Effect (YEP auto passive/buffs & states) [SOLVED]

I am trying to have more critical hit effects (common events), such as with Critical Hits from Certain Hit skills. Yanfly discussed how to do a regular physical critical hit effect here, which requires Auto Passive States, and Buffs & States Core. (Note that the code shown on the page has a mistake, but I have fixed it.)

I got a critical hit common event to work for both physical attacks and magic attacks. The code I am using for magic attack is the following:

<Custom Establish Effect> if (this.isMagical() && target.result().hpDamage > 0 && target.result().critical) { $gameTemp.reserveCommonEvent(420); } </Custom Establish Effect>

I tried to replace "this.isMagical" with "this.isCertain" and that doesn't seem to work. I made to to have automatic auto passive states for these states as well. Any idea what would work for this?

Also, if you can help me know how to make a different effect for critical certain hit attacks vs certain hit healing, that could also be fun to try out. I would guess that hp damage would have to be under 0 rather than over 0 for healing, but I haven't tried that out yet.
I tried to replace "this.isMagical" with "this.isCertain" and that doesn't seem to work. I made to to have automatic auto passive states for these states as well. Any idea what would work for this?

You're looking for "this.isCertainHit()".

These two code blocks should be useful if you're using Yanfly's Skill Core or Buffs & States Core to check if an ability dealt health damage or healed. You can also append "&& this.isCertainHit()", "&& this.isMagical()", "&& this.isPhysical()", and "&& target.result().critical" to the conditions in the if statement to check for certain hits, magical hits, physical hits, and critical hits, respectively.

Code:
//this executes if the action dealt hp damage
if (this.isHpEffect() && value > 0) {
code goes here
}

//this executes if the action healed hp
if (this.isHpEffect() && value < 0) {
code goes here
}
You're looking for "this.isCertainHit()".

These two code blocks should be useful if you're using Yanfly's Skill Core or Buffs & States Core to check if an ability dealt health damage or healed. You can also append "&& this.isCertainHit()", "&& this.isMagical()", "&& this.isPhysical()", and "&& target.result().critical" to the conditions in the if statement to check for certain hits, magical hits, physical hits, and critical hits, respectively.

Code:
//this executes if the action dealt hp damage
if (this.isHpEffect() && value > 0) {
code goes here
}

//this executes if the action healed hp
if (this.isHpEffect() && value < 0) {
code goes here
}

Everything looks like it is working now, thanks!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/certain-hit-critical-effect-yep-auto-passive-buffs-states-solved.148322/