We should send this countdown msg from a publish function that gets called by exec function for treatment end only once per second (see how this msg is sent by rinseback mode for example). And should send the message all the time. If in the wait for rinseback state, just send zeroes (and UI won't show countdown). If in paused state, always send 300 seconds for timeout and 300-(bloodSittingTimerCtr / 20) for countdown (don't let it go negative or wrap though). If an alarm dialog is being displayed, it should show the countdown for the whole 5 minutes (not just the last minute after warning).
All of these terms are integers and cast is coming too late (after division). To prevent loss of precision on division, we want to cast both sides of the division as floats.
I am assuming you are purposely adding "treatmentBackClicked" signal for clarity here? The back signal from the base (EndTreatmentBase) can be detected as part of the EndTreatmentRinseBackConnect Item.