hm... From what I can see of the files, why not associate every unit to a number, then use arrays to know the game state and all? Enemies would use the same with a number for name, icon, and base stats, then you could create another 2 arrays for stat boosts. It would decrease the computation needed for each round of the battle.
It would require an overhaul of the files though, so it might be a lot of work.
Sorry if you did this already, it's just my two cents as a past coder to optimize the code.
It would let the game run with less lag because while there is a little, it's still noticeable. I'd assume it's itch.io, but some optimization never hurts anyone but the coder.