So this a way to deal with it using the new Scriptlet plugins in GP4:
A more complex example using many different Scriptlets is given here:
Have fun with these stuffs