Attenuating peaks of a signal in a specific direction Consider a segment of a time-domain signal shown in the following graph and the two marked peaks, the first one facing downwards (in red) and the second one facing upwards (in black).


I would like to attenuate the peak facing downwards only. Unfortunately, both peaks seem to have the same frequency, so a linear filter that attenuates that frequency will attenuate both peaks.
Is there a kind of a filter (perhaps a non-linear filter) that can attenuate peaks that face downward and keep peaks that faces upward (or vice-versa)?
My immediate approach to this: try something that I'd call a running-minimum filter:

Look at a fixed amount of $N$ samples around the current sample. If the current sample is significantly below that, modify the sample to be closer to a low-pass variant of the original signal.