The hacking continues below. I had to come up with a way for the step building process to reverse if the slope suddenly changed. Usually, when you try this sort of thing in Desmos, you find yourself taking advantage of symmetric patterns in the function construction. The hardest part was breaking through that assumption, I think.