By the way, here's my horrible version that seems to actually work (kinda).
Main Issues:
1) Not really macroable, I'm just exploiting BatBrain's damage formulas (biggest issue, it takes like 15 seconds per combat)
2) Since I didn't know how to get the maximum possible damage, I took the...