Just for your information, let me introduce one of my artifacts (published 2 years and 6 months ago) to you.
This artifact shows how I dynamically modified the internal of Katalon Studio using Groovy’s Metaprogramming technique.
I do not understand what you @peter.hevesi want to do, so I am not sure if this artifact is informative for you. May be not.