Thank you for your reply.
Yes, you are right, the proposed by you approach would be a more elegant solution. Here
you can find a sample about updating a number field from the Cloud Code (if applicable).
Let me know if you have further questions or suggestions.