Past perfect continuous subjunctive in the third conditional
The past perfect continuous subjunctive can be used in the if-clause of a sentence in the third conditional to express an unreal action in the past which is imagined as continuous:
If the driver had been wearing a seat belt, he would probably have survived the accident.
If I had been living in New York at the time, I would have gone to the show.
If I hadn't been working all day, I would have gone jogging.