MV Yanfly Critical Hit Effects, animation not entirely working (plus questions about other effects)

so i looked up how to make an animation play when an attack triggers critical and found that you can use yanfly's Auto Passive States and the Buff State Core plugins in conjunction to do so, i did and the effect works good for the most part, but i've noticed some skills just don't trigger the animation for some reason, i was wondering if it was due to the "Physical" in the code but some skills with that trait just also don't trigger the animation like in this gif, is there something causing this?



Here's the code i put in the note tags for the state that gets applied to both actors and enemies.

<Custom Establish Effect>
if (this.isPhysical() && target.result().hpDamage > 0 && target.result().critical) {
target.startAnimation(6);
}
</Custom Establish Effect>

an additional but not necessary question is if i could use a variant of this code to also make it play animations whenever weaknesses or resistances are triggered.
i was wondering if it was due to the "Physical" in the code but some skills with that trait just also don't trigger the animation like in this gif, is there something causing this?
mind sharing a screenshot of myria's skill? the check for isPhysical is just if the skill's hit type is set to physical instead of certain or magical. the only thing i could think of after seeing the gif is that the skill doesnt have crits enabled or isn't physical.

an additional but not necessary question is if i could use a variant of this code to also make it play animations whenever weaknesses or resistances are triggered.
Code:
<Custom Establish Effect>
if (this.calcElementRate(target) > 1 && value > 0){
  target.startAnimation(x);
}
</Custom Establish Effect>
although depending on if you want both popups being able to show and how to show them, you might want the checks adjusted so that only either one or the other can show at a time, both the crit and weakness animations are positioned to not overlap when used together, or to make a critical weakness popup to be used in the event both happen

Edit: dropped parenthesis
mind sharing a screenshot of myria's skill? the check for isPhysical is just if the skill's hit type is set to physical instead of certain or magical. the only thing i could think of after seeing the gif is that the skill doesnt have crits enabled or isn't physical.
of course
1753716536746.png

with that comment i just realized that yes, a lot of her skills are certain hits, since she's the support and applies statuses i made most of her skills certain so the chance to miss isnt from the physical hit but the status not proccing, there is also more party members that use magical hits as their hit type, i assume i would also have to add another custom establish that checks for this type of hits then?

although depending on if you want both popups being able to show and how to show them, you might want the checks adjusted so that onle either one or the other can show at a time, both the crit and weakness animations are positioned to not overlap when used together, or to make a critical weakness popup to be used in the event both happen
no worries i plan to pretty much them having animations in different positions so they dont overlap each other, one thing i forgot to mention is that id ask and assume this could also apply to resistances, all in all they are not meant to be that intrusive since they last just like 6 frames but wanted some cool visual rewarding flair whenever you hit crits and weaknesses correctly
i assume i would also have to add another custom establish that checks for this type of hits then?
if you end up with skills of all types being able to crit, then IMO the better solution is to remove the hit type check entirely and just leave it as target.result().hpDamage > 0 && target.result().critical.
this could also apply to resistances
yeah, just reverse the one I gave earlier to so that it checks if the element rate is less than 1 instead of greater than.
Code:
this.calcElementRate(target) < 1
if you end up with skills of all types being able to crit, then IMO the better solution is to remove the hit type check entirely and just leave it as target.result().hpDamage > 0 && target.result().critical.

yeah, just reverse the one I gave earlier to so that it checks if the element rate is less than 1 instead of greater than.

got it, will prolly post the end result in my profile post in a bit, thank you very much for the help!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-critical-hit-effects-animation-not-entirely-working-plus-questions-about-other-effects.179216/