This is sort of from the top of my head, so might not be exactly right.
changepointframe == 0;
for (i = timeToFrames(time); i <= timeToFrames(inPoint); i--){
if (effect("Beat Count")("Slider").valueAtTime(i*thisComp.frameDuration)
What it is meant to do is look backwards from the current time frame by frame until the beat count slider goes smaller than the value of the variable cnt (which is the value of the slider at current time), and when it finds that point, it ends the loop, assigning that frame number to the variable changepointframe.
If you multiply with frame duration (changepointframe*thisComp.frameduration), it gives you the time where the decay should start.
Kalleheikki Kannisto
Senior Graphic Designer