I couldn't be bothered with modifying the main script so here's a quick hack that goes straight in the panel. It's for Playcount 2003 only with no options to switch.
// ==PREPROCESSOR==
// @name "Rating 2003"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\panel.js"
// @import "%fb2k_component_path%samples\js\rating.js"
// ==/PREPROCESSOR==
var panel = new _panel({ custom_background : true });
var rating = new _rating(0, 0, 24, RGB(255, 128, 0)); // x, y, height, colour
rating.properties.mode.value = 2;
rating.get_max = function () {
var max = 5; // foo_playcount_2003 max supported value is 10
this.w = this.h * max;
return max;
}
rating.get_rating = function () {
return panel.tf('$if2(%2003_rating%,0)');
}
rating.set_rating = function () {
var handles = fb.CreateHandleList(panel.metadb);
handles.RunContextCommand('Playcount 2003/Rating/' + (this.hrating == this.rating ? 'Clear' : 'Set rating to ' + this.hrating));
handles.Dispose();
}
panel.item_focus_change();
function on_colours_changed() {
panel.colours_changed();
window.Repaint();
}
function on_item_focus_change() {
if (panel.selection.value == 0 && fb.IsPlaying) return;
panel.item_focus_change();
}
function on_metadb_changed() {
rating.metadb_changed();
}
function on_mouse_lbtn_up(x, y) {
rating.lbtn_up(x, y);
}
function on_mouse_leave() {
rating.leave();
}
function on_mouse_move(x, y) {
rating.move(x, y);
}
function on_paint(gr) {
panel.paint(gr);
rating.paint(gr);
}
function on_playback_new_track() {
panel.item_focus_change();
}
function on_playback_stop(reason) {
if (reason != 2) {
panel.item_focus_change();
}
}
function on_playlist_switch() {
on_item_focus_change();
}
function on_size() {
panel.size();
}
It uses a default max value of 5 but can be edited to 10 inside the get_max function.