Get size of game screen, output half of it to game variables

So, what I want to do is have a plugin get the screen width and screen height of the game when a plugin call is ran, however, it divides the width and height by 2 and then outputs the results to 2 separate variables.


So, if the game's width is 1366 x 768, it will output 683 to one variable and 384 to another.
Script call instead, since it's not more than 2 lines of code:


$gameVariables.setValue(VariableID1, Graphics.boxWidth/2);
$gameVariables.setValue(VariableID2, Graphics.boxHeight/2);


Or full plugin (didn't test):

Spoiler
Code:
//=============================================================================
// MrTS_DimensionsToVariables.js
//=============================================================================

/*:
* @plugindesc Saves dimensions to variables.
* @author Mr. Trivel
*
* @param Width Variable ID
* @desc ID for variable to save half of width in.
* Default: 2
* @default 2
*
* @param Height Variable ID
* @desc ID for variable to save half of height in.
* Default: 3
* @default 3
* 
* @help 
* --------------------------------------------------------------------------------
* Terms of Use
* --------------------------------------------------------------------------------
* Don't remove the header or claim that you wrote this plugin.
* Credit Mr. Trivel if using this plugin in your project.
* Free for commercial non-commercial projects.
* --------------------------------------------------------------------------------
* Version 1.0
* --------------------------------------------------------------------------------
*
* --------------------------------------------------------------------------------
* Plugin Command
* --------------------------------------------------------------------------------
* SaveDimensions - Saves dimensions into two variables.
* --------------------------------------------------------------------------------
*
* --------------------------------------------------------------------------------
* Version History
* --------------------------------------------------------------------------------
* 1.0 - Release
*/

(function() {
	var parameters = PluginManager.parameters('MrTS_DimensionsToVariables');
	var paramWVID = Number(parameters['Width Variable ID'] || 2);
	var paramHVID = Number(parameters['Height Variable ID'] || 3);

	//--------------------------------------------------------------------------
	// Game_Interpreter
	// 
	
	var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
	Game_Interpreter.prototype.pluginCommand = function(command, args) {
		_Game_Interpreter_pluginCommand.call(this, command, args);
		if (command.toLowerCase() === "savedimensions") {
			$gameVariables.setValue(paramWVID, Graphics.boxWidth/2);
			$gameVariables.setValue(paramHVID, Graphics.boxHeight/2);
		}
	};
})();

Original thread: https://forums.rpgmakerweb.com/threads/get-size-of-game-screen-output-half-of-it-to-game-variables.61906/