401K/Roth Fringe Match Combined

SOLVED

I'm curious if anyone has a situation similar to what we have with our 401K/Roth Matching and how they went about creating the formula.  I've looked at several KBs on the Sage website and none will seem to match what we are doing or don't appear that they will.  I've the requirements below, the issue that I can't seem to figure out is the splitting of the formula for the roth portion.

Company Matches Dollar for Dollar up to 3%, and .50 up to 5.  This  is combined the max match between both together.

Ex 1: Employee Contributes 5% to 401K and 3% to Roth.  Match would be 4% to 401K and 0% to Roth.

Ex 2: Employee Contributes 3% to 401K and 2% to Roth. Match would be 3% 401K and 1% to Roth.

Ex 3: Employee Contributes 1% to 401K and 4% to Roth.  Match would be 1% to 401K and 3%  to Roth.

Any help or suggestions would be greatly appreciated.