Centering Scrolling Text

So Dreadwing93 made a script where if you turn a Switch ON, it will center text in Show Message commands:

Spoiler: Dreadwing93 Script
(function() {

var parameters = PluginManager.parameters('dread_centerText');
var CENTER_TEXT_SWITCH = Number(parameters["switch"]);
var ALLOW_NEGATIVE_OFFSET = parameters["allow_negative"]==="true";

var override_startMessage=Window_Message.prototype.startMessage;
Window_Message.prototype.startMessage = function() {
override_startMessage.apply(this,arguments);
centerText.call(this);
};
var override_process_newline=Window_Message.prototype.processNewLine;
Window_Message.prototype.processNewLine = function(textState) {
override_process_newline.apply(this,arguments);
centerText.call(this);
};
function centerText(){
if(!$gameSwitches.value(CENTER_TEXT_SWITCH)){ return; }
var x = this._textState.x;
var text = this._textState.text.slice(this._textState.index,Infinity).split('\n')[0];
var width = this.textWidth(text);
if (!ALLOW_NEGATIVE_OFFSET && x+width > this.contents.width){ return; }
this._textState.x = (this.contents.width - x - width)/2 + x;
}

})();

I was wondering, is there a way to modify this to work with a Show Scrolling Text command?

Original thread: https://forums.rpgmakerweb.com/threads/centering-scrolling-text.84867/