Entering or leaving a focus mode is available as an automation trigger. So, for each focus mode, create an automation that runs when you enter that focus mode. Have the automation store your focus state (on, or off, or which focus mode you’re in) in Data Jar. Then for your shortcut that needs to know if you’re in a focus mode, just check with Data Jar.
Im sorry to be dense but I don’t see any trigger on macOS for focus mode coming on or off. Checked Automator, too. There is a Shortcut action for setting it on or off but that’s not the same thing. Checked iOS and there is a trigger for when Do Not Disturb turns on or off. I see no triggers at all yet on macOS (but would love to).
Focus modes can be set to propagate across all your devices. Switching a focus mode on via macOS could also then automatically enable that focus mode on your iPhone which would trigger the automation on your iPhone (enabling/disabling a focus mode is an automation trigger in Shortcuts on the iPhone/iPad (via the Automations tab, Create Personal Automation)). The iPhone automation can then update the Data Jar entry to reflect the new focus mode. Data Jar is cross-platform so the entry would be readable via macOS to obtain the current focus mode.