Creating Cubase Patch Scripts

There is a collection of Yamaha scripts here, perhaps you could use a similar script as a starting point. In addition, there is the (very) old ScriptMaker which was quite useful but has never been updated.