I was able to find a fix on my end, in the script the 10th line down you have "pokemon" when you should have "pkmn"
like this
elsif MultipleForms.hasFunction?(pkmn, "getFormOnEnteringBattle") || MultipleForms.hasFunction?(pkmn, "getMegaForm") || MultipleForms.hasFunction?(pkmn...