sinc project and project task

Hi to all, actually i have a project list with a field “sum value” and “diff value”. When i create a project task with a field “value” and when i create this project task i want that value goes in the “sum value” field and “diff value” field as sum and diff of the value in this field and the value of project task. I’ve read about hooks but i really don’t get how they works. Could someone help me?