You had two errors:
1) The RHS of three definitions t2f..t.4f were wrong and so those variables got the unit s^2, which was the cause for the error you got
2) You mixed up T.p and T.P (lower/upper case P).
Why didn't you use units from the very beginning? It looks to me that you just added the units (s, A) because I used them in the sheet I posted. They are not necessary at all for plotting, I just thought it would be a good idea to use units, too.
BTW, I am not sure if I interpreted correctly the picture you sent. For the spikes I assumed the peak to be at the beginning of the time t.a1 and not at the end - not sure if thats what you want.