I have finally updated my hero wars contest calculator to use almost
the correct rules - the only place where it diverges slightly is when
masteries are cancelled and then abilities are adjusted by modifiers,
and in the penalties for going below -10. It's a DOS executable, with
C++ source code and should port easily.
http://www.snark.freeserve.co.uk/hw/
Phil.