I suggest the user data API. This API allows adding custom syncable metadata to individual notes.
The table of contents plugin tutorial should also have an example that shows how to use this API.