Instead of adding fanX_min to the set fan value, use the larger of either the set value or the fan minimum value. This prevents unexpectedly high fan when setting the fan to a relatively low value in the slicer. No changes were directly made to the Qmode settings.