The Hidden Data Macro built into Confluence has this parameter:
WhenEmpty - If present, will check if the named field is empty. If so, the contents will be hidden.
Based on the guidance here, I should be able to create a Text Data Macro (with a specific name, e.g. "project") within the Hidden Data Macro, have the Hidden Data Macro check the "project" Text Data field, and if the field is not empty, the Hidden Data should display.
I have tried all manner of names and configurations of the macros being in one another or separate and have not managed to trigger this once.