Your statement of the requirements for standardisation is incorrect, since your equation for the sample variance is wrong. You have also given an example where the "frequencies" are not integer values (they are proportions). In my answer I will correct for this by assuming you can get values of $a$ that are your actual frequencies.
You have unique values $x_1, ..., x_Q$ with corresponding frequencies $a_1, ..., a_Q$, so you have $n = \sum a_i$ total data points. The sample mean and sample variance for your data are given by:
$$\bar{x} = \frac{\sum x_i a_i}{\sum a_i} \quad \quad s^2 = \frac{\sum (x_i - \bar{x})^2 a_i}{\sum a_i -1}.$$
These can be simplified by defining the statistics $m_n \equiv \sum x_i^n a_i$ for $n=0,1,2$. With a bit of algebra, we can then write these statistics as:
$$\bar{x} = \frac{m_1}{m_0} \quad \quad s^2 = \frac{m_2 m_0 - m_1^2}{m_0 (m_0-1)}.$$
Your studentised values (giving zero sample mean and unit sample variance) are:
$$y_q = \frac{x_q - \bar{x}}{s} = \frac{\sqrt{m_0 (m_0-1)}}{m_0} \cdot \frac{x_q m_0 - m_1}{\sqrt{m_2 m_0 - m_1^2}}.$$
You can easily use your data to calculate the statistics $m_0, m_1, m_2$ and then calculate these studentised values. The studentised value will have zero sample mean and unit sample variance, as desired.