Hi Matthias,
you can try this:
First, calculate the duration of each capsule using "Signal from Condition" tool:
Then you can use timesince() to calculate the percentage value over the duration and also splice() to insert it into the base signal of 0% everytime the condition is met:
0%.splice(timesince($condition.removeLongerThan(40h), 1min)/$duration, $condition)
Did I understand your question correctly?
Regards,
Thorsten