I know that this is a very silly question but I cannot work out how to do it. I want to subtract 300 from the values on each row on the trial1 column if they are larger than 29
Your first attempt was close but there is no -= operator in base R, so you need to supply the subset on the right hand side as well.
-=
sums[sums$trial1 > 299,"trial1"] <- sums[sums$trial1 > 299,"trial1"]-300