I need the formulas for IV and Damage Calculations.

Anyone have them?

As for why I'm posting this here: I'm planning to code IV and Damage calculators for TPM.

I figured most sites have one, but none of them really have a directly downloadable one (closest is serebii.)

I also need values for Natures for the IV formulas if possible.