Change tech tree cost?

How would I go about making a plugin to change the prices of the tech tree?

There is a hook specifically for this.

https://umod.org/documentation/games/rust#onresearchcostdetermine

Here's some code to get you started. This example will only apply to the tech tree.

Dictionary<string, int> ItemCostOverrides = new Dictionary<string, int>()
{
    ["rocket.launcher"] = 50
    ["explosive.timed"] = 100
};

object OnResearchCostDetermine(ItemDefinition itemDefinition)
{
    foreach (var entry in ItemCostOverrides)
    {
        if (entry.Key == itemDefinition.shortname)
            return entry.Value;
    }
    return null;
}​

Note that this won't display a different price to the player since that isn't something that Facepunch coded to be networked. This means it may appear as though they have insufficient scrap, but clicking the unlock button may work if the plugin overrides the cost.

The other variation of the hook in the documentation is for the cost to scrap an item at the research table. I believe it has a similar problem, which is that the player must have the full vanilla scrap amount in the research table in order to initiate the research, but it will only charge the amount determined by the plugin.