You are assuming that every battery has the same decay rate, and capacity, which is wrong.
There is a lot of mathematics involved in estimating a battery charge, and it has its own name fancy name: State of Charge Estimation (SoC) and Remaining Useful Life estimation (RUL).
For Li-Ion batteries, estimating the SoC involves having a model of the battery (which actually involves a lot of math), and a method for extrapolating the SoC based on a number of things: battery health, charge use profiles, etc. This is usually done by mathematical estimation and prognosis methods: Kalman Filtering (EKF, UKF) and Particle Filtering (AKA Monte Carlo) are two great approaches.
You can't assume everything is constant and linear all the time, and you cannot assume that every battery is equal (not even same model/make batteries are equal in terms of charge and discharge).