How about a single timer for a pulse that counts a counter. Set counter.PRE to 5, Reset when counter.DN. (looking at your line above I'm guessing 6 steps. 0 through 5)(I had to add periods to get the lines to line up)
Then if the counter.ACC = 1 or 3 AND alarm bit is TRUE set the alarm output.