Modifying PEN attribute Holder to work as a script (instead of a plugin)

Hi, I´m currently working on a custom built bone rig in my internship. I love the PEN attribute holder for storing poses, but my employer doesn´t want me to use any plugins, so I thought about modifying the original script to work as a simple maxscript, instead of a plugin. My scripting knowledge is still very basic, but I´ve managed to add the rollouts and menues by doing this:

replace

plugin modifier 'PEN_Attribute_Holder 2'
   name:"PEN_Attribute_Holder 2"
   classID:#(0x9004a801, 0xa7617106)
   version:2

with
ca=attributes PEN_Attribute_Holder2

and add
custAttributes.add $.modifiers[1] ca

after the end of the original script.

So I add a standard attribute holder, run the modified script and I have all the rollouts and menus. I can even save presets, but now I´m stuck, because if I now add any custom attributes and try to use the ramp slider, I only get an error message like this:

-- Error occurred during fileIn in StringStream:"#("; line number: 1
-- Error occurred in rampCa_Sl.changed()
--  Frame:
--   val: 0.1165
--   vals: undefined
>> MAXScript Rollout Handler Exception:
-- Compile error: Unexpected end-of-script  <<

With my basic knowledge it seems like the script isn´t reading the other custom attributes I add.

Any ideas how to tackle this problem?