Trouble Hiding With Last Window

I'm trying to set up a trigger that allows me to hide (cmd+h) an application when left clicking the orange window button when it's the last (only 1) instance/window of the app.

Is this possible? I tinkered for a while with Advanced Conditions to no avail. I thought running processes might be relevant to the amount of windows of an application but I realise now probably not.