The battle code is open source, so if you want to see how it is actually coded, here is the source:
https://github.com/FutureShockco/drugwars.js
It is obviously subject to change. I believe they are planning to update the logic soon, but IDK what they are planning to change (or when).
THX a lot... I will try to read it.. ;-)