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"
                 class="someclass"
                 icon="icon.png">
        <description>example-macro</description>

        <device-type>mobile</device-type>
        <category name="formatting"/>

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

            <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"/>
        </parameters>

    </xhtml-macro>

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: https://community.atlassian.com/t5/Answers-Developer-Questions/Cannot-add-macro-parameters-programmatically-in-Confluence/qaq-p/483349
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.