Almost forgot, when doing the solution for #4, you need to put the switch statement in a if block and test the skill for type THROWING since the ApplyMeleeDamageBonus doesn't know that automatically. This way the damage bonus only gets applied if it is a throwing attack, like it should...
Code:
if(skill == THROWING)
{
switch(GetAA(aaThrowingMastery))
{
case 1:
MaxDmg = MaxDmg * 115/100;
break;
case 2:
MaxDmg = MaxDmg * 125/100;
break;
case 3:
MaxDmg = MaxDmg * 150/100;
break;
}
}