attacks that effect player and enemy

I want to make attacks that would hurt the enemy but also have an effect on the player. like an attack that does 50 damage to the enemy, then 10 to the user or an attack that adds a debuff or state after use.
in your damage formula:

a.hp -= (math); b.hp -= (math);a = skill user

b = target

to add states, use:

Code:
a.add_state(id); b.add_state(id);
I wasn't aware that the formula could do that, of course if I would have taken the time to read it I may have figured out. Laziness is a terrible disease that I suffer from. Actually I can't get the formula to damage the user still.
can't help there when you are not showing any examples of how you fail to make it work.
battle formula.png

I've tried other things, however I feel this is the closest I've got. 

battle formula.png
I've tried other things, however I feel this is the closest I've got.
That doesn't work because it is not a complete code sequence.If you have more than one command, those commands need to be divided with a ; like in the original example several posts above.

Additionally, it's a.hp -= 10 or alternatively a.hp = a.hp - 10 if you want to change a.hp.

And third, the last number of any working code sequence will always be the damage to be reduced from the target. Having b.hp as part of the last number will usually autokill all targets because their HP-Number will be the damage caused.

Corrected it's

Code:
a.hp-=10;30
That will do 10 damage to the skill user and 30 damage to the skill target.
Like what Andar explained above, 

need -= to minus something from a variable (in this case, hp)

and you need to separate the lines (commands) using ; in between them.

check the example i've 1st shown you.

and like what Andar said, if you are setting it up under damage formula, any numbers on the last line (code behind the last ; ) will be counted as damage against the target. so you can skip the b.hp -= 10; code. note, if a formula ends with ; it will run a nil as damage
Thank you so much, both of you.
You're welcome!

Original thread: https://forums.rpgmakerweb.com/threads/attacks-that-effect-player-and-enemy.54841/