I'm not entirely sure how that plugin is configured but as far as I remember, skills can have conditionals. You can also do something like "a.atk*4-b.def*2+(Math.max(a.level-b.level, 0) * 99999999)"
I'll break that down. "a.atk*4-b.def*2" pretty simple, its how the default skills are set up. 4 times that attackers attack - 2 times the defenders defense.
"(Math.max(a.level-b.level, 0))" This is some simple code. It will get the higher value of the two sides. One is attackers level - defenders level and the other is 0. This means if a.level - b.level is less than 0 because the attackers level is lower than the defenders level, that little bit of code will choose 0 as the max. If attackers level is higher, it will choose the deference between the attackers and defenders levels and then do the next part which is multiply by 99999999.
That means if the attackers level is the same or lower it will add 0 * 99999999 = 0 but if the attackers level is even 1 higher it will add 1 * 99999999 = 99999999 damage which I assume will oneshot anything.
The tricky part is since I don't use that plugin I don't know how they set up level for enemies. It's possible b.level is not valid code. Might b._level or something totally different.
If you look through the plugin, it shouldn't be too tricky to figure out I hope. If you still have trouble, link the plugin and I'll figure out exactly what it should be.
EDIT: Ok I found a better way. "if (a.level > b.level) {b.addState(1)}; a.atk*4 - b.def*2;". I still don't know if b.level is the correct code without seeing the plugin though.
Sorry for the delay, got health issues to deal with. Anyway the code taken from that plugin should mean my guess was correct so the formula you want to use is: "if (a.level > b.level) {b.addState(1)}; a.atk*4 - b.def*2;"
Replace a.atk*4 - b.def*2 with whatever you want the damage to actually be.
I think it should be:
if (b.elementRate(6) > 1.0) {b.addState(1)}; a.atk*4 - b.def*2;
Again you can change the second part to whatever you want, thats just the default physical attack damage value. In the "b.elementRate(6)" 6 is the default ID for earth element. You can check which ID it is in types tab in case you've changed it. I haven't tested this but it should work.