Looking for some help with Mark Duplicate Script

Hey folks,
Fairly new to Airtable and javascript ( my background is database languages ).

I’m trying to modify the Mark Duplicate script that is an example.

I’m using it as part of an automation from a google sheet.

Rather than marking the duplicates I’d like to increment a counter by one on the “master” record already in the base

Take some of the data from a field called “Notes” on the new record and add it to the “Notes” field on the “master” record

Then ignore the new record as it’s not required.

If anyone can give me any pointers that would help me better get to grips with the syntax it would be massively appreciated.