How do i make a spike effect in battle?

Hello RPG Makers, i want to ask how i can make a spike effect like in the Mario Series.

I want the enemy to have a spike effect, that when ever mario uses a jump attack he himself gets dmg and the enemy does not take any dmg

im using yanflys action sequence plugins.

(sorry for my bad english)

thx for the help!

have a nice day
If you want it to do that for all Physical attacks, just add the trait Counter+100%. (which is a special param rate)
On the other hand if you want it to only apply to specific physical skills there are a couple ways you could do it. The easiest way I see is to do the following. (NOTE: you will need Yanfly's buff states core
Make an element called Jump. All attacks which will be effected by the Spike should have the Jump element.
Then
Make a state called counter, this state should add the trait Counter+100%. And it should have a 100% chance of being removed by damage.
Then make a third state with the following in it's text box.
HTML:
<Custom Respond Effect>
var element = this.item().damage.elementId;
if (this.isDamage() && element === x) {// with x being the element ID of Jump
  target.addState(y);// with y being the State ID of counter
}
</Custom Respond Effect>

This should work, but test it to make sure. I hope this helped.
Im not at my pc atm, but i will try it when i get home

Edit: I'm a little bit confused, where do i place the state with the script? do i need passivestates from yanfly or what do i do with it?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-spike-effect-in-battle.83164/