Scriptcall to check if damage is Magical

I dug around some of his other plugins and found the code myself. If a mod sees this, please feel free to close this thread, thank you! 😀


Hello all. How would i do a scriptcall/conditional to check to see if damage being taken is MAGICAL?


I am currently using Yanfly's plugin to recreate his "Stagger" tips and tricks (linked at the bottom of the post), but from what I see, it only works on Physical damage taken.


The spoiler shows the code. How do i get it to work on BOTH physical AND magical damage?

Spoiler
<Custom React Effect>


if (this.isPhysical() && this.isHpEffect() && value > 0) {


target._staggerDmg = target._staggerDmg || 0;


var reduce = Math.ceil(value * 0.35);


value -= reduce;


target.addState(142);


target._staggerDmg += reduce;


}


</Custom React Effect>
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.



@Fernyfer775 It's usually better to Report your opening post and ask for the thread to be closed.  It's easy to miss a post, but we will see your Report.  Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/scriptcall-to-check-if-damage-is-magical.73868/