Hi Doug,
Cost cannot be assigned directly. You need to set the rate tables of each resource in order to set the daily cost of the resource. Following is a sample code which changes the rates on different days for a resource. When we open the task usage, we can see the new cost according to the rates set on specific dates. Please give it a try and share the feedback.
Project proj = new Project(“Project2.mpp”);
Resource res1 = proj.Resources.GetByUid(1);
Rate rate1 = res1.Rates.Add(new DateTime(2016, 5, 2, 8, 0, 0));
rate1.RatesTo = new DateTime(2016, 5, 4, 8, 0, 0);
rate1.StandardRate = 6;
rate1.RateTable = RateType.A;
Rate rate2 = res1.Rates.Add(new DateTime(2016, 5, 4, 8, 0, 0));
rate2.RatesTo = new DateTime(2016, 5, 30, 8, 0, 0);
rate2.StandardRate = 4;
rate2.RateTable = RateType.A;
proj.Save(“Project2.mpp”,SaveFileFormat.MPP);