How to programatically change Macro page based on condition

I’m working on a simple macro based on the Macro interface. I want to change the macro’s fields (parameters) based on a simple condition. I’ll try to explain it further below.
Say my atlassian-plugin.xml consists of

    <xhtml-macro key="key" name="testmacro"

        <category name="formatting"/>

            <parameter name="some-content" type="enum" >
                <value name="a"/>
                <value name="b"/>
                <value name="custom"/>

            <parameter name="h1" type="string"/>
            <parameter name="h2" type="string"/>
            <parameter name="h3" type="string"/>
            <parameter name="h4" type="string"/>
            <parameter name="h5" type="string"/>
            <parameter name="h6" type="string"/>


Now for example, say we have the following screenshot:

And we state that this is the base case. All information is displayed the left panel. Now i’d like to change that information based on some condition (for example the date that the page was created on). For example this would look like this:

Now i want to macro to keep on working in the same manner on each page, the only thing that should change are the options presented to you on the left pane.

Now i’ve seen the discussions over here: Cannot add macro parameters programmatically in Co...
and successfully added new values into a certain parameters with macroDefinitionParameters.put("visited", new Date().toString()); but that’s not quite what i want since i’m trying to alter the complete macro (except for the output).

Would this be possible with for example javascript by using AJS.MacroBrowser?

I don’t have an example handy but a few years ago I was able to exit a usermacro’s preview pane and change settings dynamically. It’s technically possible but difficult and messy.