Skill that damages and also buffs the caster?

Hello everyone, good evening!
I'm having a certain problem with a skill formula. You see, I want to make a skill sort of like "Power-up Punch" in Pokémon, but for the love of God I can't make it work.

I not only cause 0 damage to the enemy, but also buff THEM and then get TPK'd lol

1600387778711.png


This is the formula I'm using, I have absolutely no idea if I'm doing it wrong or something, or if I should change anything.
I've been crying for six hours over this, I'd be very grateful if you could help me out!
Thank you!
yes, the damage formula is wrong - you need to remove the < > around it as that breaks the code

and are you sure you want to use a division there? That will NOT work with the regular values as it reduces the damage to almost zero if reguar def values are used.
and third, if you really want division then you need to use parentehesis ( ) around its parts to tell the computer what is divided by what.
1600388827596.png


should it be like this, then?
Or how should I make it then if I don't add the division? I'm totally lost in here lol
No, that's wrong too. I believe the syntax you want in MV is:
a.addState(7); a.atk * 5 / (b.def * 2)

Note that a.atk * 5 / b.def * 2 is the same as a.atk * 10 / b.def, which is why we need the parentheses to double the Defense stat. Also note that addState is the way it's written in MV; add_state is the correct syntax for Ace and earlier.

Your formula will result in some pretty low values if battlers' ATK and DEF stats are anywhere near equal. For example, with 100 ATK and 80 DEF, the formula would evaluate to 500 / 160 = 3 damage.
No, that's wrong too. I believe the syntax you want in MV is:
a.addState(7); a.atk * 5 / (b.def * 2)

Note that a.atk * 5 / b.def * 2 is the same as a.atk * 10 / b.def, which is why we need the parentheses to double the Defense stat. Also note that addState is the way it's written in MV; add_state is the correct syntax for Ace and earlier.

Your formula will result in some pretty low values if battlers' ATK and DEF stats are anywhere near equal. For example, with 100 ATK and 80 DEF, the formula would evaluate to 500 / 160 = 3 damage.

Ohhh it did work now! Thank you so much! I'm new to doing events and stuff, I'm mostly oriented to graphic design and I made the maps and everything for the game, and left the wucky stuff for last lol

Thank you again and bless your souls. I will check on formula posts and try to learn how to properly make functional stuff

Original thread: https://forums.rpgmakerweb.com/threads/skill-that-damages-and-also-buffs-the-caster.127525/