You change [or add] the appropriate attribute[s] for the dynamic_component and then force it to refresh thus...
assuming the dynamic_componentis referenced by 'dc' and you know the 'key'/'value' wanted...
dc.definition.set_attribute("dynamic_attributes", 'key', 'value') $dc_observers.get_latest_class.redraw_with_undo(dc)
🤓