You may need to limit the decrement counter so that it never goes below 0
Code:
If DutyVar3 > 0 then
    DutyVar3 = DutyVar3 -1
else
    DutyVar3 = 0
endif
Cheers
Barry
VK2XBP