New Skill - Masork

I would like to create a skill that damage the user, but he receives a bonus on attacks. The more he attacks, more damage he takes and more damage he will cause. 


I tried, but it did not decreased when a state ended. Can anyone help me?
on state


<Custom Establish Effect>


if (value >=1) {


target._masork = target._masork + 1


target.setStateCounter(target._masork)


target.gainHp(target._masork * -X)}


</Custom Establish Effect>


on all skills you want more damage


<Before Eval>


target._masork = target._masork || 0


</Before Eval>


<damage formula>


value = normal formula


value += (target._masork * X)


</damage formula>
Which values I have to change? Only the "x" on skills and state? Because when the actor has the state, it only cause damage 0 with the skills and attack.
The X is however you want to multiply the damage and life loss.


You should have quoted me to have your answer faster, l don't recheck threads.

Original thread: https://forums.rpgmakerweb.com/threads/new-skill-masork.71777/