Make a backup of your project before following this guide. Then close the project and follow the instructions below.
Download the files linked below, there are different versions for UE4 and UE5 download the files for the engine version your using.
Unreal Engine 5
Unreal Engine 4
Once downloaded un zip the folder and copy the video below in your projects files.
You can now open the project, you will need to go to the Build Part List and set the Resource Cost and Repair Cost for each build part in the Build Part List like shown in the image below.

For wood set the Resource to Wood, for stone set the Resource to Stone, and for iron set the Resource to Iron.