Seal of Righteousness-like State

I want to add a state to my game that makes it so that when a character is with it and makes a normal attack, the normal attack has additional damage from some element.
Reference skill: Seal of Righteousness (World of Warcraft):
https://www.wowhead.com/classic/spell=20289/seal-of-righteousness
it can be done with yanfly's buffs & states plugin, but i cant tell you much more without you being more specific

Code:
<custom confirm effect>
if (this.isAttack()) value += Math.ceil((Math.randomInt(21)+9)*target.elementRate(x))
</custom confirm effect>
change the x for the id of the element you need

Also, damage isnt elemental. skills are. there isnt "elemental damage" past the skill doing the damage having x element. you can fake it the way i did above by multiplying the bonus by the target's element rate, but its not dealing "elemental damage"

Original thread: https://forums.rpgmakerweb.com/threads/seal-of-righteousness-like-state.169710/