BeerSmith already has a cost feature baked in. You must update the databases to reflect your vendor costs, though. With malt and hops, the unit cost increments are the same as you have in your defaults
(options menu).
Misc items are also costed per dose unit, but you can choose what the unit is, plus tell BeerSmith how much per XX recipe units. thus, the dosage can be grams, ounces, liters or pounds per gallon, if your recipes are calculated in gallons. In short, you can state the dose exactly as the manufacturer does and BeerSmith will calculate both the dose per batch and the cost.
Cost by percentage is not a calculation BeerSmith makes.