How do I write a procedure for creating a buffer?
Initial note

The specific problem with your scenario is, that you need a buffer of buffer capacity progressively decreasing with increasing $\mathrm{pH}$, but capacity of simple buffers is for $\mathrm{pH} \lt \mathrm{p}K_\mathrm{a}$ increasing.

As consequence, its "breaking" capacity is too big, compared to "withstanding capacity".

General analysis

Let there is given the initial $\mathrm{pH_{ini}}$ and the acid dissociation constant
$\mathrm{p}K_\mathrm{a}$

Let there there is given "breaking volume" of $\ce{NaOH}$ $V_\mathrm{br}$, where the buffer losses it's buffering ability.

Let there is given "withstanding volume" $V_\mathrm{ws}$ when $\mathrm{pH}$ changes by value $x$.

Then:

$$\mathrm{pH_{ini}}=\mathrm{p}K_\mathrm{a} + \log {R}$$

where 

$$R=\frac{ [\ce{A-}]_\mathrm{init}}
{[\ce{HA}]_\mathrm{init}}=10^{\mathrm{pH_{ini}}-\mathrm{p}K_\mathrm{a}}$$

$$\mathrm{pH_{ini}}+x=\mathrm{p}K_\mathrm{a} +\log  \frac {R+V_\mathrm{ws}/V_\mathrm{br}\cdot (1-R)}{1-V_\mathrm{ws}/V_\mathrm{br}}$$

If we consider 
$$R_1=10^{\mathrm{pH_{ini}}+x-\mathrm{p}K_\mathrm{a}} $$
$$V_\mathrm{r}=V_\mathrm{ws}/V_\mathrm{br}$$

then 
$$R_1=\frac {R+V_\mathrm{r}\cdot (1-R)}{1-V_\mathrm{r}}$$



$$V_\mathrm{r}=\frac {R_1-R}{R_1-R+1}$$

Goal

The desired $$V_\mathrm{r}\ge \frac{25}{35}=0.714$$

Acetic acid case

If we consider acetic acid with $\mathrm{p}K_\mathrm{a}=4.75$ then $$R=10^{3.75-4.75}=0.1$$

If the change should be $\Delta \mathrm{pH}=0.5$:

$$R_1=10^{3.75+0.5-4.75}=0.316$$

$$V_\mathrm{r} =\frac{0.316-0.1}{0.316-0.1+1}=0.177\lt 0.714$$

If the change should be $\Delta \mathrm{pH}=1.0$:

$$R_1=10^{3.75+1.0-4.75}=1$$

$$V_\mathrm{r} =\frac{1-0.1}{1-0.1+1}=0.475 \lt 0.714 $$

Formic acid case

If we consider as a replacement e.g. formic acid with $\mathrm{p}K_\mathrm{a}=3.75$ then $$R=10^{3.75-3.75}=1$$

If the change should be $\Delta \mathrm{pH}=0.5$:

$$R_1=10^{3.75+0.5-3.75}=3.16$$ 

$$V_\mathrm{r} =\frac{3.16-1}{3.16-1+1}=0.684\lt 0.714$$

If the change should be $\Delta \mathrm{pH}=1.0$:

$$R_1=10^{3.75+1.0-3.75}=10$$ 

$$V_\mathrm{r} =\frac{10-1}{10-1+1}=0.9 \gt 0.714$$

Summary


Acetic acid is unuseable for making a buffer to fit your requirements.
Formic acid can be used to make a buffer with "withstanding" parametr $\Delta~ \text{pH} \lt +1.0$, seen in the other question.
Formic acid very tighly missed the "withstanding" parametr $\Delta~ \text{pH} \lt +0.5$, so seems about usable.
Even better results could be achieved with an acid with $\mathrm{p}K_\mathrm{a} \lt 3.75$ .