Simply adds seconds so you don’t have to Math, useful for transitioning from Marlin as they already have P or S in the G4 command.
[gcode_macro G4]
rename_existing: G4.1
gcode:
{% set SEC = params.S|default(0)|int %}
{% set MILI = params.P|default(0)|int %}
{% if 'P' in params %}
G4.1 P{MILI}
{% elif 'S' in params %}
{% set F = 1000*SEC %}
G4.1 P{F}
{% endif %}