Plug-Ins : How to set a variable equal to an enemy's element rate???

I am messing around with a small plugin, and I am wondering how on earth do I set a variable to an enemy's element rate of a certain element?

I tried:

var thisVariable = enemy.elementRate(3);This is just an example case. It keeps telling me the function is undefined, so what is the alternative to setting "thisVariable" to equal the elementRate for a certain element of that enemy?

Original thread: https://forums.rpgmakerweb.com/threads/plug-ins-how-to-set-a-variable-equal-to-an-enemys-element-rate.48646/