to be going to die or stop functioning very soon; to be very weak or in bad condition
BE ON YOUR / ITS LAST LEGS
Meaning of BE ON YOUR / ITS LAST LEGS in English
Oxford Advanced Learner's English Dictionary. Оксфордский английский словарь для изучающик язык на продвинутом уровне. 2005