var total1=Math.floor(INT*(Swd+(2*Mgc)+Gun)/6); var total2=Swd+Gun; var total3=Math.min(30,Swd)+Math.min(30,Mgc)+Math.min(30,Gun); var total4=Math.max(0,Swd-Mgc)+Math.max(0,Gun-Mgc); var BaseSP=total1+total2+total3+total4;

Tried with INT=38 ; Swd=31 ; Mgc=40 ; Gun=46

Result: BaseSP=1167

Value to find: 1198

31 SP missing…