fire thorns effect?

So for one of the skills in my game I want to have a spell that surrounds the caster in flames causing fire damage to whatever enemies hit them with physical attacks with a slight chance to burn them, and at the same time causing the caster's physical attacks to deal fire damage and giving every physical attack a slight chance to burn the target.
All well and good on the ideas side, but I don't know how to implement it, so if anyone has any clue on how to make this possible I'd appreciate any help you might be willing to lend.
Thanks in advance!
Using Yanfly's plugin, you can do this state. It's been a long time since the last JS state I made, but you definitely can.
fire_thorns.png

Replace the 4 with the ID of your fire element and 20 in dmg with whatever you want the base thorns damage to be. This requires Yanfly's Buffs & States Core if you don't have it already.

Code:
<Custom React Effect>
if (value > 0 && this.isPhysical()) {
  var dmg = THORNS DAMAGE;
  dmg *= user.elementRate(ID OF FIRE);
  user.gainHp(-1 * dmg);
  if (user.isDead()) {
    user.performCollapse();
  }
}
</Custom React Effect>
I don't know what I did wrong, but I did something wrong. >_>
Spoiler: Images
Screenshot (159).png
Screenshot (158)_LI.jpg
As a general rule I try not to be a complete idiot, but sometimes I can't help it. :hswt:
Help please? 😀
Where I've put THORNS DAMAGE you need to actually replace that with a number.
(Facepalm) Oh yeah duh, that make sense. Thank you~

Original thread: https://forums.rpgmakerweb.com/threads/fire-thorns-effect.76896/