Suppose you want to try and do some... more complicated things with your calculator, such as see what happens if you have Anatomical Precision or Blight Storm up (which means you always do at least one damage if you hit), or your damage when you auto-hit, or when you get to re-roll all missed attacks once (due to Combined Arms or Fortune)?
Well, you take the code from the original calculator and replace select lines as follows. If you want to modify it by several aspects, so long they modify different lines go ahead, if not, look at the "What I did" and modify as applicable, or post asking for help:
Auto-hit:
Replace:
q := (if (hitcheck=1) then (call damage (f, xr)) else 0);
With:
q := call damage (f, xr);
(What I did: Simply removed rolling the attack in the end. You can also remove the whole "Hitcheck..." line to speed things up.)
Anatomical Precision:
Replace:
function damage(f, xr) =
h := sum(f)d6; if (xr>=h) then 0 else (h-xr)
With:
function damage(f, xr) =
h := sum(f)d6; if (xr>=h) then 1 else (h-xr)
(What I did: You only get to this roll if you hit the enemy, so what I did was replace "Then 0" with "Then 1", because this is how much damage you do if you don't pass the armour.)
Anatomical Precision analysis (pMorghoul):
Assuming you hit all, then interesting results: (at this stage I suddenly remembered Maltreatment, so up to 14 attacks, not 12 anymore!)
For 14 attacks: ARM 18, 15.55 damage; ARM 17, 17.88; ARM 16, 21.77; ARM 15, 27.611.
For 12 attacks: ARM 17, 15.33; ARM 16, 18.66; ARM 15, 23.66.
For 10 attacks: ARM 16, 15.55; ARM 15, 19.722.
Once you take into account DEF, it drops down, but then it becomes more important to boost damage, especially with Savage, which I might work on...