MV I need help with <custom react>

I am using Yep_BuffStateCore and I am trying to make that when a player takes a hit from an 'X' element to play an animation on it. I was trying to enter some code in <custom react> but I don't know much about js. Could someone help me with a code?
Try this (it goes in a state notetag) :
JavaScript:
<Custom Respond Effect>
if(this.item().damage.elementId = x) {
target.startAnimation(y);
 }
</Custom Respond Effect>
Change x to the element ID in your database
Change y to the animation ID you want to play on the target
Let me know if that helps!
Try this (it goes in a state notetag) :
JavaScript:
<Custom Respond Effect>
if(this.item().damage.elementId = x) {
target.startAnimation(y);
}
</Custom Respond Effect>
Change x to the element ID in your database
Change y to the animation ID you want to play on the target
Let me know if that helps!

It's perfect for what I need, thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-help-with-custom-react.127650/