Oh, I see the problem. However, I don't know why you have it since the plugins I had been looking at (the ones I upload to mega) doesn't have it.
To fix it, in pbWildDifficultyCharms(pkmn)
, modify every instance of "pkmn" to "pokemon" or the other way around (I have them all as pkmn on the uploaded plugin, but it'll be faster to have them as pokemon in your case).