You are applying the "if" statement to a parameter during the simulation. Parameters MUST have an assigned value BEFORE the start of the simulation. You cannot use the if statement to change the value of a parameter during the simulation. You need to generate the changing duty cycle in another way.