Trouble adding new parameters to Window_EquipStatus

So I've tried to add HIT and CRI to the equip status window, but the text won't display.  I've added this code to Window_EquipStatus

Code:
def refresh    
	contents.clear    
	draw_all_items  
end    

def draw_sparam(x, y, value)    
	change_color(normal_color)    
	draw_text(x, y, 100, line_height, value, 2)  
end    

def draw_sparam_name(x, y, name)    
	change_color(system_color)    
	puts "#{name}"    
	draw_text(x, y, 80, line_height, name)  
end  

def draw_all_items    
	9.times {|i| draw_item(0, line_height * (i), 2 + i) }  
end   

def draw_item(x, y, param_id)    
	puts "#{param_id}"    
	if param_id == 9      
		draw_sparam_name(x, y + line_height * 7, "HIT")      
		draw_sparam(x + 120, y + line_height * 7, @actor.hit.to_i.to_s) if @actor    
	elsif param_id == 10      draw_sparam_name(x, y + line_height * 8, "CRI")     
		draw_sparam(x + 120, y + line_height * 8, @actor.cri.to_i.to_s) if @actor    
	elsif param_id <= 7      
    	puts "f"     
        draw_param_name(x + 4, y, param_id)      
        draw_current_param(x + 94, y, param_id) if @actor      
        draw_right_arrow(x + 126, y)      
        draw_new_param(x + 150, y, param_id) if @temp_actor    
    end  
end

All the puts commands were for debugging purposes, and by that I've figured out that draw_sparam and draw_sparam_name are being called, and that the correct name and values are being passed to the methods, but for whatever reason, its just not appearing in the window.  (I've neglected to add the scripts that changed the size of the window to make room for these new parameters)
'@actor.hit.to_i' and '@actor.cri.to_i' will be 0 or 1 most probably.


X-params and S-params are measured in float numbers, so 0.90, 0.65, and so on, and these mean 90%, 65%, etc.


Converting a value lower than 0 to integer will be set to 0.


You can display these stats if you multiply them by 100 and than convert them to integer.


But...


They are not showing up probably because you have set the alignment for the value display to be right aligned.


You also draw them 120 pixels to the right compared to the X-param names. That means it will be drawn around 220 pixels to the right (minus the width of the value).


If you want to draw the name left aligned and the value right aligned, set the width and X position of both of them to be the same, and just put 2 as alignment for the value display. If the two text collide, just increase the width of the value text, nothing more.


Aside from this, you also added 'line_height*7' and 'line_height*8' to their Y position. That is not needed. In the 'draw_all_items' method you have already set the Y position of the drawings to be one line below the previous stat. Remove the '+line_height*Z' lines from the 'draw_item' method.

Original thread: https://forums.rpgmakerweb.com/threads/trouble-adding-new-parameters-to-window_equipstatus.55104/