Ignore Guard in damage formula?

Hello, I have a skill that does 50% of current target's hp as damage. If the target's hp is 1, then it does 0 damage. I want these damage values to remain true even when the target is guarding - is there a way to ignore guard's damage mitigation in the damage formula? My current formula is:


if (b.hp === 1) 0; else 0.5 * b.hp


Thanks in advance!
If you're not using any "Guard Rate" features, you can simply check in the damage formula whether the target has the Guard state, and if so do b.hp in damage instead of b.hp/2 (since the Guarding will halve it).  If you are using the Guard Rate, or doing anything else really unique with Guarding, then a scripting change would probably be necessary to ignore it completely.
The solution is quite simple just add this to your formula:


(Your Formula) * (b.isGuard() ? 2 * b.grd : 1)


Basically, if the target is guarding it multiples the damage by the guard amount which will later be divided by guard amount. If the target is not guarding nothing will happen. No plug in needed.
If you're not using any "Guard Rate" features, you can simply check in the damage formula whether the target has the Guard state, and if so do b.hp in damage instead of b.hp/2 (since the Guarding will halve it).  If you are using the Guard Rate, or doing anything else really unique with Guarding, then a scripting change would probably be necessary to ignore it completely.


The solution is quite simple just add this to your formula:



(Your Formula) * (b.isGuard() ? 2 * b.grd : 1)


Basically, if the target is guarding it multiples the damage by the guard amount which will later be divided by guard amount. If the target is not guarding nothing will happen. No plug in needed.



Yup, thanks for the info! I figured it out by checking for the guard state in the damage formula as suggested.
Oh, nice call, @Adventurer_inc..  It was late, I was tired, and I forgot you could use b.grd in the damage formula - so even if you're using Guard Rate, you're still good.  If you're adding other effects to the Guard, though, then it could still get dicey without scripts.

Original thread: https://forums.rpgmakerweb.com/threads/ignore-guard-in-damage-formula.61155/