You can subtract $40,000 of military retired pay from your Virginia taxable income. Thrift Savings Plan distributions do not count as retired pay and cannot be subtracted.
There is nothing to apply for in advance. Claim the subtraction on your Virginia income tax return using your Form 1099-R figures.
Your Form 1099-R showing your military retired pay.