OnBeforeTaskUpdate has a bug

OnBeforeTaskUpdate cannot get past values, only the latest values

Hello,
This is expected behavior, and you can find that information in the article:

If you mean that you try to obtain the task object with the gantt.getTask(id) command and you get the modified task object, it is because the event fires after the task is actually modified in the datastore.

You need to use the specific event handlers before the task is modified:
onBeforeTaskDrag fires when you drag a task in the timeline:

onLightboxSave fires when you modify a task in the lightbox:

onBeforeSave fires when you modify a task property in the inline editor: