Hi,
Thank you for reaching out to the Google Ads Scripts support team.
I would like to inform you that our support is focused on guiding users to troubleshoot specific issues within their own scripts, rather than providing hands-on implementation or creating scripts on a user's behalf.
I would suggest that you create a script by referring to the sample codes available in the Performance Max document. Also, I would recommend that you refer to AdsApp.PerformanceMaxCampaign and AdsApp.AssetGroup documents for all the available methods in Performance Max campaigns.
I hope this helps! Feel free to get back to us with the following details for any further concerns.