Problem with using GetPluginCaption

You cannot reference a plugin or widget in a scriptlet

The same issue as you already posted in
Declaring variables in loops and concatenating function outputs inline