Passing the objects by ref would let you do this - for example
if (key == 'B')
{
BuyX (ref bstr, ref bstrCost, ref sp, 10);
}
public static void BuyX(ref double bstr, ref double bstrCost, ref double sp, double z)
See here for full details: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref