MV Item Command Window - Getting width from content width.

I've look around, and even found this particular thread here, but wasn't successful at implementing it. I've spent a good few hours trial-and-erroring this as well, but no luck.

What I'm looking for is a snippet of code that I can paste into, say, YEP_ItemCore within
Code:
Window_ItemActionCommand.prototype.windowWidth = function() {
 SNIPPET HERE
};
or that could go into any function like that to set the width of a command window to the content it's populated by. I mean, if it's possible?

I've looked into other scripts that do similar things, like GALV's Message Style, since he's got this kind of thing working for the text boxes, but he's got a whole system in place in the .js and my eyes can't seem to find a bit that could work, OR even how to extrapolate what he's doing and doing something similar.

Any help would be greatly appreciated! Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/item-command-window-getting-width-from-content-width.149315/