Payroll Formula Help

I need to create a formula that excludes portions of Gross Pay from Retirement contribution. For example: 

RegularPay (Include)

OvertimePay (Include)

Incentive (exclude)

Holiday (exclude)

The employee must contribute 5% in accordance with the Union Contract, but is not allowed to contribute 5% of incentive or holiday pay or any other pay.

Here is our current formula

"STANDARD formula created by Peachtree Software."

LIMIT=14000.; "The value specified by the user for the 401K limit fields."
CLIMIT=20500.00; "401kCLimit value from Taxinfo.dat"
L=IF(EMP_401K_CATCHUP,CLIMIT,LIMIT);
A=EMP_401K_NUMBER%*ADJUSTED_GROSS;
B=-YTD(K401)+K401;
C=A-((A+B)-LIMIT);
D=IF((A+B)<LIMIT,A,C);
ANSWER=-D