How to access retry Time Cycle count?

My problem can be solved like this, and your suggestion. And it’s something I do fairly often. Im looking for a more clean solution.

The second image is what im hoping to achieve.
I can almost achieve this with retry time cycle. It’s just that the last failure I need to direct the flow to a meaningful direction. Which would be possible if I can check a retry counter or something and say
if ( retryCounter != 0) {
DoAnotherRetry()
} else{
NoMoreTriesTakeAnotherPath()
}