Trying to create a release / falloff

Hi everyone

I’m trying to get some kind of release/falloff effect (like the one found in an ADSR envelope). Im using a WindowsAudioCapture component and changing the scale of a cube, driven by the windows audio / microphone input. I want the scale to move towards 0 slower.

I thought about getting the values of the array and then do something like:
“If this value is smaller than the one before it, stay at this value…” I don’t really know the best solution for this. Maybe there’s a much easier way…

Thanks in advance!