The best idea is to use the logic in the ladder, but unfortunately, Mazak which uses their own version of Mitsubishi control, makes it hard for any on-site changes to ladder.
You may have to make use of the 2sec signal into a separate outboard PLC controller.
Modern T.C. generally put tool...