If you're using UP1.5, you can simply use an upgrade unit effect, upgrading the militia to whatever unit you need.
Problem is, this still means the actual research for upgrading the unit is still available. Disabling it won't work, because by disabling it you're also disabling the ability to research further upgrades (though this isn't an issue if giving Imperial Age units).
Instead, you'd have to make each upgrade free and take no time to research, so that it removes the upgrade icon. You can use the tech cost modifier from UP 1.5. So like in the other thread, you'd have to make it similar:
#const ATTR_SET_TIME -1
#const ATTR_ADD_TIME -2
#const ATTR_SET_FOOD_COST 0
#const ATTR_SET_WOOD_COST 1
#const ATTR_SET_STONE_COST 2
#const ATTR_SET_GOLD_COST 3
#const ATTR_ADD_FOOD_COST 16384
#const ATTR_ADD_WOOD_COST 16385
#const ATTR_ADD_STONE_COST 16386
#const ATTR_ADD_GOLD_COST 16387
To reduce the food cost by x, you would ATTR_ADD_FOOD_COST -x, so the fields would be (tech ID), 16384, 0, -x.
You'll need to repeat for gold cost.
To reduce the time, you would #const ATTR_SET_TIME -1 0, so the fields would be (tech ID), -1, 0, 0. This will SET the research time to 0.
[This message has been edited by Sebastien (edited 01-28-2019 @ 02:11 AM).]