Copy and paste error
Factorize
Make $ramp_down_countdown count in seconds
Minor edits (of comments)
Allow (a more) rapid ramp-down until 3500rpm, instead of until the midpoint between min and max