CubePilot CubeOrange+ I2C2 with Lua and Arduino Problems

I do not think you are in the right direction. Battery cycles should include tracking charging, like the DJI smart battery.
Here are some examples.

  1. add-smart-battery-monitoring-to-a-non-smart-battery
  2. rotoye-batmon-tested-with-ardupilot

Then you press a button the latest battery cycle is shown.

Battery Monitor may be, cycle, may not.