Hello,
I don't understand the requirement. Send deadline emails at 3 different times, which can be random?
Surely the values of X, Y and Z will be known. If X <= Y <= Z then try setting X to latest start, Y to requested end and Z to latest end.
regards
Rick