No need to add a plugin!
Just use this formula:
a.gainHp(-Math.floor(a.mhp * .25); a.atk * 6 - b.def < you can replace everything after the ; with whatever damage formula you want.
Then you have an attack that does damage to you = 25% hp
There are a few downsides to note though...
Yanfly's engine goes around these issues.
1) if the player is affected by a state that reduces that type of damage you would need to alter the formula. So, if you have a state that reduces damage the player takes by 50%...then it would affect this 'cost' since it isn't actually a cost, but damage being delt back to the player.
You can get around this, if you have such states you can just add it as a variable into the equation.
a.isStateAffected(3) ? a.gainHp(-Math.floor(a.mhp * .50); a.atk * 6 - b.def : a.gainHp(-Math.floor(a.mhp * .25); a.atk * 6 - b.def
Just put the number of the state in the equation and it would deal increased damage back to the player in that situation. Giving the program an 'else' conditional branch within the damage. However, if you have a lot of these states, then it could get annoying, but not mathmatically a problem.
2) Also, the damage is damage being delt to the player...which means it can miss. This is the biggest 'downside' to the equation option. Because of this, when I use this ability type, I use 'certain hit' and save my hp cost abilities as being very powerful and should not miss. You can up the chance to hit, if you don't want to use 'certain hit' and just make it impossible to miss...but that means that it can't miss the enemy.
3) On hit effects will proc for both the player and the enemy. If you have 'add state normal hit' on this attack, then the enemy will be hit with the effects of the weapon the character has and so won't the player. Because of this, I don't use the add state normal hit, and say in my skill descriptions that these attacks do not apply on-hit effects
Yanfly's plugin gets around all this and lets you just type in the cost in the notes...but I have found a way to make it work using the default engine.
Hope that helps!