In recent versions of Discourse there is a comment about this in the Plugin API code:
/**
* ```
* api.decorateCooked(
* $elem => $elem.css({ backgroundColor: 'yellow' }),
* { id: 'yellow-decorator' }
* );
* ```
*
* NOTE: To avoid memory leaks, it is highly recommended to pass a unique `id` parameter.
* You will receive a warning if you do not.
**/
It looks like all you need to do is pass an { id: 'your-id' } option to the method call.