<Ace> Yanfly's Extra parameter formula - How to make it not affect enemy?

I have found this script very useful for character's builds for my project. FYI, when I firstly added this script to my project and created some formulas, it worked very well without any problem. But when I quit and re-tested, I got error when hit enemy..

'Game_Battler' line 482: NameError occurred. undefined local variable or method 'level' for #<Game_Enemy:0x6eff03c>

It is my personal preference to use "level" as main factor for most formulas (it is very easy to create a diminishing return formula). However; I completely forgot that an enemy has no level!

Is there a way to adjust the formula only affect actor but not enemy?

Thank you!

PS: You can find the said script here: 

https://github.com/Archeia/YEARepo/blob/master/Core/Extra_Param_Formulas.rb
You might be able to do this with a if actor? command before your formula. Maybe try this:

if actor?

  insert your formula here

else

  formula for enemy here (maybe just the default, so it has something to return?)

end

You will need to do this for all formulas for it to work. (Note: I do not have RPGMaker where I'm at, so if you hit an error I won't be able to assist for a few hours)

Alternatively, try installing Yanfly's enemy level's script. That might solve the problem completely as well.

Original thread: https://forums.rpgmakerweb.com/threads/ace-yanflys-extra-parameter-formula-how-to-make-it-not-affect-enemy.37939/