Help me write a multiple light/multiple door automation

Doors (all have zwave contacts)::
Door at the top of the stairs (Stair Door) leading down to the basement.
Door from basement going into the garage.
Door from garage going outside.

Lights (all have zwave switches)::
Basement Stair Light
Garage Light

Want:

When the basement stair door is opened because I’m going downstairs, IF the Basement Stair Light has not been switched on - turn it on for two minutes, then turn it off. If it WAS switched on with the switch - do nothing.

When the basement door to the garage is opened because I’m going into the garage from the basement, IF the Basement Stair light has not been switched on, turn it on for two minutes then turn it off AND if the garage light has not been switched on, turn it on for two minutes then turn it off. (so if the Basement stair light is already on, whether switched and staying on, or on it’s two minute countdown from the automation, leave it on if switched, turn it off after two minutes if on automation, just turn on the garage light for two minutes, and vice versa if I was coming in FROM the garage to the basement).

When the garage to outside door is opened because I’m coming into the garage from outside, IF the garage Light has not been switched on, turn it on for two minutes then turn it off.

The first and third automations I can write - it’s including that second one - even coming up with that second one, that I can’t quite do.

Thanks for any help.