Little formula help

Hello guys. I met a little problem. So i creating a very ineteresting game, and now i got stuck. My game have a match logical battle system, and i dont know how to create this skill type:

Every skill granted a specific damage. And if the player use a bad skill game over.
Example: The mob have 50hp, but your skill attack value 60, need to game over screen, or a self damage-

I trying this formula: 90+a.atk > b.hp ? 20+a.atk my Logic, how If the player dmg overdamage the enemy hp ( b-hp -> Current hp) then only dmg 20 ( this only example) but total not working.. Some idea or help? I Dont know how to create a self dmg, i try cal variable but not work =(

Thx in advance !
<Before Eval>
target._asd = target.hp
</Before Eval>

<Post-Damage Eval>
if (value > target._asd) {
SceneManager.goto(Scene_Gameover);
}
</Post-Damage Eval>

Self Damage

<Post-Damage Eval>
if (value > target._asd) {
user._overdamage = (value - target._asd)
user.gainHp(user._overdamage * -1)
}
</Post-Damage Eval>
Thanks a lot of your help. Its work perfect.Everywhere search an information but i did not think how the skill core need, and that include this commands 🙂

Original thread: https://forums.rpgmakerweb.com/threads/little-formula-help.75974/