n.appendHit(Misc.random(40), 0);
n = npc
appendhit = doing 2 hits
misc random = something between 0 and "input of number"
0 is use of the int or use of the void or whatever
it means it's max hit is 2x 40 so that'd be 80, but it randomizes so the change is very low that it will ever hit 40-40